Breadcrumb v0.1.0 Navigation

Navigation trail; the last item is marked aria-current=page automatically.

import { Breadcrumb } from "latticeui-react";

Examples

Basic

Show code
<Breadcrumb
  items={[
    { label: "Home", href: "#" },
    { label: "Settings", href: "#" },
    { label: "Billing" },
  ]}
/>

Custom separator

Show code
<Breadcrumb separator="›" items={...} />

Anatomy

These data-part attributes are a versioned public API - style and test against them; they will not change in a minor release.

PartElementStable selector
rootnav[data-scope="breadcrumb"][data-part="root"]
listol[data-scope="breadcrumb"][data-part="list"]
itemli[data-scope="breadcrumb"][data-part="item"]
linka[data-scope="breadcrumb"][data-part="link"]
separatorspan[data-scope="breadcrumb"][data-part="separator"]

Props

PropTypeDefaultDescription
items *{ label: string; href?: string }[]
separatorReactNode"/"

Accessibility

Roles: navigation

Styling

Override styles by targeting the stable selectors below from any unlayered CSS - it always beats the library's @layer latticeui styles, no !important needed.

[data-scope="breadcrumb"][data-part="link"] {
  /* your overrides */
}

State attributes: aria-current="page"