Breadcrumb
import { Breadcrumb } from "@cherry-design-system/react";
export function Trail() {
return (
<Breadcrumb
items={[
{ label: "Docs", href: "/docs" },
{ label: "Components", href: "/docs/components" },
{ label: "Combobox" },
]}
/>
);
}Breadcrumb shows where the current page sits in a hierarchy, from the root to the current page. It is a <nav> with an ordered list and no client JavaScript, so it is safe in Server Components.
Examples
Slash separator
import { Breadcrumb } from "@cherry-design-system/react";
export function Trail() {
return (
<Breadcrumb
separator="slash"
items={[{ label: "Projects", href: "/projects" }, { label: "Website" }]}
/>
);
}Translated landmark name
import { Breadcrumb } from "@cherry-design-system/react";
export function Trail() {
return (
<Breadcrumb
aria-label="Fil d'Ariane"
items={[{ label: "Accueil", href: "/" }, { label: "Paramètres" }]}
/>
);
}Properties
Trail from the root to the current page (the last entry). Each entry is { label: ReactNode; href?: string }; omit href on the last entry, it is the current page.
Glyph between entries. Defaults to "chevron".
Names the landmark. Defaults to "Breadcrumb".
Breadcrumb renders a <nav> around an <ol>, forwards its ref to the <nav> and passes other attributes through.
Styling
| Hook | Values |
|---|---|
| Class | cherry-breadcrumb |
data-separator | chevron, slash |
| States | [aria-current="page"], :hover, :focus-visible |
| Parts | cherry-breadcrumb__list, cherry-breadcrumb__item, cherry-breadcrumb__link, cherry-breadcrumb__current, cherry-breadcrumb__separator |
Links read --cherry-fg-muted and turn --cherry-fg-default on hover; separators use --cherry-fg-subtle.
Accessibility
Breadcrumb is a navigation landmark named "Breadcrumb". The current page is aria-current="page", separators are hidden from assistive tech, and links have 24px targets.