Loading component…
Loading component…
Where a page sits and the way back up – links with quiet separators, the current page last, a long middle folded into a … menu, long names shortened with the full one on hover
To reuse this local React demo, copy all files from the Code tab into the same folder, then import Breadcrumb from ./breadcrumb.
import { Breadcrumb } from "@/components/ui/breadcrumb";
export function RunHeader({ agent, run }: { agent: { id: string; name: string }; run: { title: string } }) {
return (
<Breadcrumb
items={[
{ label: "Agents", href: "/agents" },
{ label: agent.name, href: `/agents/${agent.id}` },
{ label: "Runs", href: `/agents/${agent.id}/runs` },
{ label: run.title },
]}
/>
);
}| Name | Type | Default | Description |
|---|---|---|---|
| items | BreadcrumbItem[] | From the top down; the last one is the page you are on – shown in ink, not a link, marked aria-current="page" | |
| items[].label | string | The name. Long ones shorten with … at 200px and show in full on hover | |
| items[].href | string | Makes the crumb a link | |
| items[].onClick | (event) => void | Without href the crumb is a button; with href it runs first (call preventDefault to navigate with a router) | |
| items[].icon | ReactNode \| HugeIcon | A 14px glyph before the label, e.g. the workspace's mark on the first crumb | |
| separator | "slash" \| "chevron" \| ReactNode | "chevron" | What sits between the crumbs – a 14px chevron (mirrored right to left), a quiet slash or your own |
| maxItems | number | 4 | The most crumbs shown; past it the ones after the first fold into …, so the first and the last ones stay. A row too narrow folds more on its own |
| aria-label | string | "Breadcrumb" | Names the navigation landmark |
| ...nav props | ComponentProps<"nav"> | className, style, ref and the rest go to the <nav> |
One line that never wraps: crumbs shorten first, the current page last; when they would get too short, more of the middle folds into …
Touch screens get larger hit areas around the crumbs and the …, and taller menu rows – the text doesn't move
Right to left: the chevrons turn round and the menu opens from the right edge
Dark mode built in: switches when an ancestor (usually <html>) has the class dark or data-theme="dark"
@import "tailwindcss"; in your main CSS file.