Breadcrumb
Where-am-I trail; the last item is the current page.
Example
import { Breadcrumb } from "@porcelana/ui";
export default function Example() {
return (
<Breadcrumb
items={[
{ label: "Home", href: "#" },
{ label: "Alarms", href: "#" },
{ label: "New alarm" }
]}
/>
);
}Import
import { Breadcrumb } from "@porcelana/ui";
import "@porcelana/ui/styles.css"; // once, at your app rootProps
Generated from the TypeScript types. Standard HTML attributes are passed through and not listed.
Breadcrumb
The last item is the current page (aria-current="page").
| Prop | Type | Default | Description |
|---|---|---|---|
itemsrequired | BreadcrumbItem[] | – | Trail from the root to the current page; items without href render as text. |
aria-label | string | – | Defines a string value that labels the current element. @see aria-labelledby. |
id | string | – | Element id. Generated automatically when omitted. |
renderLink | ((item: BreadcrumbItem & { href: string; }, className: string) => ReactNode) | – | Custom link renderer for client-side routers. |
separator | ReactNode | / | Separator between items (hidden from screen readers). Defaults to "/". |
Accessibility
- A nav landmark named Breadcrumb with an ordered list; the last item has aria-current="page".
- Separators are hidden from screen readers.
Mobile
- Links have 44px targets and the trail wraps onto more lines.