Breadcrumbs

A navigation breadcrumb trail with automatic aria-current="page" on the last item. Links are rendered for items with a path; the final item renders as plain text.

Import

import { Breadcrumbs } from '@adjanour/react-components'
import '@adjanour/react-components/breadcrumbs.css'

Live Example

const items = [
  { title: 'Home', path: '/' },
  { title: 'Projects', path: '/projects' },
  { title: 'Active' },
]

<Breadcrumbs items={items} />

Custom Separator

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

With React Router

<Breadcrumbs
  items={[
    { title: 'Home', path: '/' },
    { title: 'Profile' },
  ]}
  renderLink={(item, children) => (
    <Link to={item.path!}>{children}</Link>
  )}
/>

Props

PropTypeDefaultDescription
itemsCrumb[]RequiredBreadcrumb trail
separatorReactNodeChevron iconSeparator between items
renderLink(item, children) => ReactNode<a>Custom link renderer
interface Crumb {
  title: string
  path?: string
}

Theming

VariableDefaultDescription
--aw-bc-link#3b82f6Link color
--aw-bc-link-hover#2563ebLink hover
--aw-bc-current#0f172aCurrent page
--aw-bc-sep-color#94a3b8Separator
--aw-bc-gap6pxSpacing