import { Breadcrumbs } from "@senvenli/react/navigation";
export default function Example() {
return <Breadcrumbs aria-label="Location" items={[{ label: "Projects", href: "#" }, { label: "Atlas", href: "#" }, { label: "Settings" }]} />;
}import { Breadcrumbs, Breadcrumb } from "@senvenli/react/navigation";Examples
A long trail
With more than four levels, the middle ones fold into a menu.import { Breadcrumbs } from "@senvenli/react/navigation";
export default function Example() {
return (
<Breadcrumbs
aria-label="Location"
items={[
{ label: "Customers", href: "#" },
{ label: "Analytical Engines Ltd", href: "#" },
{ label: "Orders", href: "#" },
{ label: "ORD-1040", href: "#" },
{ label: "Invoices", href: "#" },
{ label: "INV-2041" },
]}
/>
);
}Composed from parts
`Breadcrumb` children with icons; the last one is the current page.import { Breadcrumb, Breadcrumbs } from "@senvenli/react/navigation";
export default function Example() {
return (
<Breadcrumbs>
<Breadcrumb href="#" icon="folder">
Projects
</Breadcrumb>
<Breadcrumb href="#" icon="folder">
Website redesign
</Breadcrumb>
<Breadcrumb icon="file-text">Launch plan</Breadcrumb>
</Breadcrumbs>
);
}Guidelines
When to use it
- Pages nested two or more levels deep.
Accessibility
Built in
- A navigation landmark; the current page has aria-current.
You provide
- With children: a textValue on a Breadcrumb whose label is not plain text, for the folded menu.
API reference
Breadcrumbs
| Prop | Type | Default | Description |
|---|---|---|---|
items | readonly BreadcrumbItem[] | – | From the section root ("Projects"), never "Home", to the current page. Leave it out to compose |
children | React.ReactNode | – | With no |
aria-label | string | – | Names the navigation landmark; "Location" by default. |
itemsreadonly BreadcrumbItem[]From the section root ("Projects"), never "Home", to the current page. Leave it out to compose
Breadcrumbs as children instead.childrenReact.ReactNodeWith no
items:Breadcrumbs from the root to the current page (the last one).aria-labelstringNames the navigation landmark; "Location" by default.
Breadcrumb
| Prop | Type | Default | Description |
|---|---|---|---|
href | string | – | A page; leave it out on the last one, the current page. |
icon | IconName | – | |
childrenRequired | React.ReactNode | – | The level's name. It may hold more than text; then give |
textValue | string | – | The words for the "…" menu when this level folds; the label itself when it is plain text. |
hrefstringA page; leave it out on the last one, the current page.
iconIconNamechildrenRequiredReact.ReactNodeThe level's name. It may hold more than text; then give
textValuefor the folded "…" menu.textValuestringThe words for the "…" menu when this level folds; the label itself when it is plain text.