Playground

Breadcrumb

The path to the current page.

  • Built on native elements
  • A nav landmark with an aria-label, containing an ordered list.
  • The current page has aria-current=page and is not a link.
  • Styles in one file: 18-navigation.css

Import

import '@monoline/css';
import {Breadcrumb} from '@monoline/react';

Not installed yet? Pick a route.

Copies the source and its styles into your project.

npx monoline add breadcrumb

Usage

import {Breadcrumb} from '@monoline/react';

<Breadcrumb
  items={[{label: 'Home', href: '#'}, {label: 'Projects', href: '#'}, {label: 'Monoline'}]}
/>

Examples

Basic

Props

BreadcrumbProps

PropTypeDefaultDescription
items requiredBreadcrumbItem[]–The trail from the root to the current page; the last item is treated as the current page and is not a link.
aria-labelstring–Name of the landmark.

Data Attributes

State is exposed through attributes. Style it with these selectors, not with class toggles.

AttributeStylesheet
[aria-current="page"]18-navigation.css
[aria-current="step"]18-navigation.css
[aria-selected="true"]18-navigation.css
[data-state="done"]18-navigation.css

CSS classes

ClassStylesheet
.brand18-navigation.css
.crumbs18-navigation.css
.pager18-navigation.css
.step18-navigation.css
.steps18-navigation.css
.tab18-navigation.css
.tabpanel18-navigation.css
.topbar18-navigation.css
.topbar-nav18-navigation.css
.divider09-links.css
.link09-links.css
.skip-link09-links.css

Customization

Style it with the kit's tokens in your own CSS, loaded after @monoline/css. Prefer the attributes above over extra classes. See Theming for every token.

app.css
.brand {
  border-color: var(--accent);
}
.brand[aria-current="page"] {
  background: var(--wash);
}

Accessibility

  • A nav landmark with an aria-label, containing an ordered list.
  • The current page has aria-current=page and is not a link.