Breadcrumb
Trail of links from the site root to the current page.
- Browsers
- Chrome 123+, Firefox 121+, Safari 17.5+
- Tier
- 0
- Bundle compressed
- 1.12 kB
- Forced layout budget
- 0 ms
- Axe budget
- 0
- SSR compatible
- Yes
- Built on
- elements/details
- Published contract
- Test harness
Playground
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
import { Breadcrumb } from "@gunkin/uiify";
export default function Example() {
return (
<Breadcrumb.Root className="">
<Breadcrumb.List>
<Breadcrumb.Item>
<Breadcrumb.Link href="/">Home</Breadcrumb.Link>
<Breadcrumb.Separator />
</Breadcrumb.Item>
<Breadcrumb.Item>
<Breadcrumb.Link current>Components</Breadcrumb.Link>
</Breadcrumb.Item>
</Breadcrumb.List>
</Breadcrumb.Root>
);
}
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
@layer components {
[data-uiify-breadcrumb] [data-part="list"] {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 0.5rem;
list-style: none;
padding: 0;
margin: 0;
}
[data-uiify-breadcrumb] [data-part="item"] {
display: flex;
align-items: center;
gap: 0.5rem;
}
[data-uiify-breadcrumb] [data-part="link"] {
color: var(--primary);
text-decoration: none;
}
[data-uiify-breadcrumb] [data-part="link"]:hover {
text-decoration: underline;
}
[data-uiify-breadcrumb] [aria-hidden="true"] {
color: var(--muted-foreground);
}
[data-uiify-breadcrumb] [data-current] {
color: var(--foreground);
font-weight: 600;
}
}
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
import { Breadcrumb } from "@gunkin/uiify";
export default function Example() {
return (
<Breadcrumb.Root
className="
[&_[data-part=list]]:flex [&_[data-part=list]]:flex-wrap [&_[data-part=list]]:items-center
[&_[data-part=list]]:[gap:0.5rem] [&_[data-part=list]]:list-none [&_[data-part=list]]:p-0
[&_[data-part=list]]:m-0 [&_[data-part=item]]:flex [&_[data-part=item]]:items-center
[&_[data-part=item]]:[gap:0.5rem] [&_[data-part=link]:where(:not([data-current]))]:text-primary
[&_[data-part=link]]:no-underline [&_[data-part=link]:hover]:underline
[&_[aria-hidden=true]]:text-muted-foreground [&_[data-current]]:text-foreground
[&_[data-current]]:[font-weight:600]
"
>
<Breadcrumb.List>
<Breadcrumb.Item>
<Breadcrumb.Link href="/">Home</Breadcrumb.Link>
<Breadcrumb.Separator />
</Breadcrumb.Item>
<Breadcrumb.Item>
<Breadcrumb.Link current>Components</Breadcrumb.Link>
</Breadcrumb.Item>
</Breadcrumb.List>
</Breadcrumb.Root>
);
}
API
Breadcrumb.Root
aria-label | string | "Breadcrumb" | Accessible name of the navigation landmark. |
render | ReactElement | ((props, state) => ReactElement) | — | Replace the rendered element while keeping behavior and accessibility wiring. |
Breadcrumb.List
children | ReactNode | — | Breadcrumb items written by hand, as an alternative to items. |
items | BreadcrumbItemData[] | — | Data-driven entries, each with a key, a label and an optional href and current flag; required when maxItems is set. |
itemsAfterCollapse | number | 1 | Number of trailing items kept visible when the trail is collapsed. |
itemsBeforeCollapse | number | 1 | Number of leading items kept visible when the trail is collapsed. |
maxItems | number | — | Item count above which the middle of the trail collapses behind an expandable ellipsis. |
separator | ReactNode | — | Content rendered between items when the list is built from items. |
render | ReactElement | ((props, state) => ReactElement) | — | Replace the rendered element while keeping behavior and accessibility wiring. |
Breadcrumb.Item
children | ReactNode | — | Content of one breadcrumb list item. |
render | ReactElement | ((props, state) => ReactElement) | — | Replace the rendered element while keeping behavior and accessibility wiring. |
Breadcrumb.Link
children | ReactNode | — | Label of the link. |
current | boolean | false | Marks this entry as the current page and sets aria-current on it. |
href | string | — | Destination of the link; omit it to render a non-navigating entry. |
render | ReactElement | ((props, state) => ReactElement) | — | Replace the rendered element while keeping behavior and accessibility wiring. |
Breadcrumb.Separator
children | ReactNode | "/" | Separator content, hidden from assistive technology. |
render | ReactElement | ((props, state) => ReactElement) | — | Replace the rendered element while keeping behavior and accessibility wiring. |
Keyboard
| Key | Action |
|---|
| Tab | Move focus to/from the control |
| Enter / Space | Activate when focused (button-like controls) |
Accessibility
Uses semantic HTML where possible. Inspect rendered markup in the playground — ARIA is added only when native elements are insufficient.
Styling hooks
data-disabled