[ Navigation ]

Breadcrumbs

Shows where the current page sits in the site hierarchy and lets users jump back up. The last item is the current page.

3 examplesDark modeAccessible

Import#

import { Breadcrumbs } from 'reusify-ui';

When to use#

  • Sites with more than two levels of hierarchy: docs, e-commerce categories, admin panels.

Examples#

Basic#

<Breadcrumbs
  items={[
    { label: 'Home', href: '/' },
    { label: 'Components', href: '/components' },
    { label: 'Breadcrumbs' },
  ]}
/>

Custom separator#

<Breadcrumbs separator="/" items={items} />

With React Router / Next.js#

Pass your router link as the label (and leave out href) to get client-side navigation.

import { Link } from 'react-router-dom';

<Breadcrumbs
  items={[
    { label: <Link to="/">Home</Link> },
    { label: <Link to="/settings">Settings</Link> },
    { label: 'Profile' },
  ]}
/>

API reference#

<Breadcrumbs />

items*-
{ label: ReactNode; href?: string; onClick?: () => void }[]

Trail from the root to the current page.

separatorchevron
ReactNode

Element between items.

Accessibility#

  • Wrapped in <nav aria-label="Breadcrumb"> with an ordered list.
  • The last item has aria-current="page"; separators are aria-hidden.