Skip to content

Navigation

Breadcrumb

tsx
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

tsx
import { Breadcrumb } from "@cherry-design-system/react";

export function Trail() {
  return (
    <Breadcrumb
      separator="slash"
      items={[{ label: "Projects", href: "/projects" }, { label: "Website" }]}
    />
  );
}

Translated landmark name

tsx
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

itemsBreadcrumbEntry[]required

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.

separator"chevron" | "slash"

Glyph between entries. Defaults to "chevron".

aria-labelstring

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

HookValues
Classcherry-breadcrumb
data-separatorchevron, slash
States[aria-current="page"], :hover, :focus-visible
Partscherry-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.