Breadcrumb
Shows the path to the current page.
import { Breadcrumb } from '@elluzion/iv-ui'; 01 Preview
Basic
Links for ancestors and plain text for the current page.
Source· svelte Show Hide
<script lang="ts">
import { Breadcrumb } from '@elluzion/iv-ui';
const items = [
{ label: 'Projects', href: '#' },
{ label: 'Orbital', href: '#' },
{ label: 'Deployments' }
];
</script>
<Breadcrumb {items} />02 Usage
- The last item without
hrefrenders as the current page. - Pass a
separatorsnippet to replace the default chevron. ariaLabelnames the navigation landmark.
03 Examples
Icons
Each item can carry an icon snippet before its label.
Source· svelte Show Hide
<script lang="ts">
import { IconFolder, IconHome } from '@tabler/icons-svelte';
import { Breadcrumb } from '@elluzion/iv-ui';
</script>
{#snippet home()}<IconHome size={12} />{/snippet}
{#snippet folder()}<IconFolder size={12} />{/snippet}
<Breadcrumb
items={[
{ label: 'Home', href: '#', icon: home },
{ label: 'Projects', href: '#', icon: folder },
{ label: 'Orbital' }
]}
/>Custom separator
The separator snippet replaces the chevron.
Source· svelte Show Hide
<script lang="ts">
import { Breadcrumb } from '@elluzion/iv-ui';
const items = [
{ label: 'Projects', href: '#' },
{ label: 'Orbital', href: '#' },
{ label: 'Settings' }
];
</script>
{#snippet separator()}<span class="sep">/</span>{/snippet}
<Breadcrumb {items} {separator} />
<style>
.sep {
font-family: var(--iv_font-mono);
font-size: var(--iv_text-sm);
color: var(--iv_bracket);
}
</style>04 API
import { Breadcrumb } from '@elluzion/iv-ui';Props
3 props · 0 events · 1 snippets| Prop | Type | Default | Description |
|---|---|---|---|
| items required | BreadcrumbItem[] | — | Trail entries. The last item is rendered as the current page. |
| ariaLabel | string | 'Breadcrumb' | Accessible name for the navigation landmark. |
| className | string | '' | Extra classes merged onto the root element. |
class, id, style, aria-*, and data-* are forwarded through rest props.
Snippets
| Snippet | Type | Description |
|---|---|---|
| separator | Snippet | Custom separator snippet; defaults to /. |
Types
BreadcrumbItem
One entry in a breadcrumb trail.
type BreadcrumbItem = {
label: string;
href?: string;
icon?: Snippet;
};05 Accessibility
- The trail is a
<nav>with an accessible name. - The current page uses
aria-current="page". - Separators are hidden from assistive technology.
06 Tokens & CSS hooks
Tokens used
Class hooks
.iv-breadcrumb.iv-breadcrumb-item.iv-breadcrumb-sep