1. Documentation
  2. Navigation
  3. Breadcrumb
ReadmeGitHub
  • Introduction
  • Installation
  • Theming
  • Icons
  • Accordion
  • Card
  • Scroll Area
  • Separator
  • Sidebar
  • Field
  • Label
  • Input
  • Textarea
  • Number Field
  • OTP Field
  • Select
  • Combobox
  • Checkbox
  • Radio
  • Switch
  • Slider
  • Toggle
  • Calendar
  • Date Picker
  • File Upload
  • Button
  • Copy Button
  • Dropdown
  • Command
  • Tabs
  • Breadcrumb
  • Pagination
  • Tree
  • Table
  • Data Table
  • Stat
  • Timeline
  • Avatar
  • Status Bar
  • Badge
  • Meter
  • Empty
  • Skeleton
  • Spinner
  • Toast
  • Dialog
  • Sheet
  • Popover
  • Tooltip
  • Text
  • Kbd
  • Code Block
  • Utilities
  • Design rules

Breadcrumb

Where you are, and the way back — collapsing the middle when the trail gets long.

  1. Projects
  2. acme
  3. acme-api
<Breadcrumb
items={[
  { label: "Projects", href: "/projects", icon: IconCube },
  { label: "acme", href: "/projects/acme" },
  { label: "acme-api" },
]}
/>

Breadcrumb renders a trail of links with the last entry as the current page — not a link, and carrying aria-current="page".

Usage

tsx
import { Breadcrumb } from "@heyo-sh/heyo-ui";

<Breadcrumb
  items={[{ label: "Workers", href: "/workers" }, { label: "acme-api" }]}
/>;

Collapsing a long trail

maxItems keeps the first and last entries and folds everything between them into an ellipsis. A breadcrumb that wraps onto a second line has stopped being a breadcrumb.

  1. Organisation
  2. …
  3. Workers
  4. acme-api
<Breadcrumb
maxItems={3}
items={[
  { label: "Organisation", href: "/" },
  { label: "Projects", href: "/projects" },
  { label: "acme", href: "/projects/acme" },
  { label: "Workers", href: "/projects/acme/workers" },
  { label: "acme-api" },
]}
/>

Router links

render swaps the <a> for whatever your router uses, per crumb.

tsx
<Breadcrumb
  items={[
    { label: "Workers", render: <Link to="/workers" /> },
    { label: "acme-api" },
  ]}
/>

A different separator

  1. heyo-sh
  2. /
  3. heyo-ui
<Breadcrumb
separator="/"
items={[{ label: "heyo-sh", href: "/" }, { label: "heyo-ui" }]}
/>

Properties

itemsCrumb[]required

The trail. The last entry is rendered as the current page.

maxItemsnumberoptional

Collapses the middle into an ellipsis past this many entries.

separatorReactNodeoptional

What sits between crumbs. It defaults to a chevron.

classNamestringoptional

Merged into the <nav>.

Crumb

labelReactNoderequired

The crumb's text.

hrefstringoptional

Makes the crumb a link. Omit it for the current page.

iconIconLikeoptional

A leading glyph — usually only on the first crumb.

renderRenderPropoptional

Swaps the <a> for a router link: render={<Link to="/x" />}.

Tabs< PreviousPaginationNext >

Powered by heyo

On this page

UsageCollapsing a long trailRouter linksA different separatorPropertiesCrumb