Install
Pull Breadcrumb from the barrel for everyday use, or the granular path when you want a tighter bundle.
import { Breadcrumb } from "@brika/clay";import { Breadcrumb } from "@brika/clay/components/breadcrumb";A minimal example
Drop this into a page. Native HTML attributes pass through to the underlying primitive.
import {
Breadcrumb,
BreadcrumbItem,
BreadcrumbLink,
BreadcrumbList,
BreadcrumbPage,
BreadcrumbSeparator,
} from '@brika/clay/components/breadcrumb';
/** Standard trail with two ancestor links and the current page. */
export default function BreadcrumbDefaultDemo() {
return (
<Breadcrumb>
<BreadcrumbList>
<BreadcrumbItem>
<BreadcrumbLink href="#">Home</BreadcrumbLink>
</BreadcrumbItem>
<BreadcrumbSeparator />
<BreadcrumbItem>
<BreadcrumbLink href="#">Settings</BreadcrumbLink>
</BreadcrumbItem>
<BreadcrumbSeparator />
<BreadcrumbItem>
<BreadcrumbPage>Profile</BreadcrumbPage>
</BreadcrumbItem>
</BreadcrumbList>
</Breadcrumb>
);
}Breadcrumb, every way
Accessibility
- Root renders
<nav aria-label="breadcrumb">, no extra landmark markup needed. -
BreadcrumbPagerendersaria-current="page"on the last item. -
BreadcrumbEllipsisisaria-hidden="true", AT skips the visual indicator. - Separator elements are presentational; AT does not read them.
Theme tokens
Every CSS variable Breadcrumb reads, with its default and the
dotted path you'd write in a ThemeConfig JSON
to override it. Set any of these in your theme to retune Breadcrumb
without touching component code.
Breadcrumb tokens
4 tokens--breadcrumb-link-foregroundcolorvar(--muted-foreground)components.breadcrumb.linkForegroundResting text color of breadcrumb links and the surrounding list (inactive crumbs).
--breadcrumb-link-hover-foregroundcolorvar(--foreground)components.breadcrumb.linkHoverForegroundText color of a breadcrumb link on hover.
--breadcrumb-page-foregroundcolorvar(--foreground)components.breadcrumb.pageForegroundText color of the current-page crumb (the last item, marked `aria-current="page"`).
--breadcrumb-separator-colorcolorvar(--muted-foreground)components.breadcrumb.separatorColorColor of the separator glyph between breadcrumb items.
Override in a theme
Authoring a theme is plain JSON. Drop overrides under
components.breadcrumb, the names
are camelCase versions of the variable suffix.
{
"id": "my-theme",
"name": "My Theme",
"description": "...",
"accentSwatches": ["#000"],
"components": {
"breadcrumb": {
"linkForeground": "var(--muted-foreground)"
}
}
}
Then apply with applyTheme(myTheme)
(see the theming guide),
scope it to a subtree with themeToCssVars(myTheme, mode),
or consume any token directly in your own JSX with the matching Tailwind utility
(e.g. bg-breadcrumb-…) — see the
chips on each token row.
API reference
Props specific to Breadcrumb. Native HTML attributes pass through to the underlying primitive, see the component source on GitHub for the full type signature.
<Breadcrumb />
passthroughNo wrapper-specific props, all attributes pass through to the underlying primitive.
<BreadcrumbEllipsis />
passthroughNo wrapper-specific props, all attributes pass through to the underlying primitive.
<BreadcrumbItem />
passthroughNo wrapper-specific props, all attributes pass through to the underlying primitive.
<BreadcrumbLink />
1 prop- booleanWhen true, render the child element instead of the default DOM node and merge props. Lets you compose with
<a>,<Link>, or another primitive while keeping behavior and styling.
<BreadcrumbList />
passthroughNo wrapper-specific props, all attributes pass through to the underlying primitive.
<BreadcrumbPage />
passthroughNo wrapper-specific props, all attributes pass through to the underlying primitive.
<BreadcrumbSeparator />
passthroughNo wrapper-specific props, all attributes pass through to the underlying primitive.