Overview
The Breadcrumbs component displays a navigation trail that helps users understand their current location within the application hierarchy.Import
Basic Usage
With Click Handlers
Custom Separator
Props
BreadcrumbsProps
ExtendsReact.ComponentPropsWithoutRef<'nav'>
| Prop | Type | Default | Description |
|---|---|---|---|
items | BreadcrumbsItem[] | required | Array of breadcrumb items to display |
separator | ReactNode | '/' | Separator element between items |
className | string | '' | Additional CSS classes |
BreadcrumbsItem
| Property | Type | Description |
|---|---|---|
label | string | Text to display for this breadcrumb |
href | string | Optional link URL |
onClick | () => void | Optional click handler |
Behavior
- The last item is automatically marked as the current page
- Items without
hreforonClickare rendered as plain text - The last item is always non-interactive
- Separators are hidden from screen readers with
aria-hidden
Accessibility
- Wrapped in a
<nav>element witharia-label="Breadcrumb" - Uses semantic
<ol>list structure - Last item has
aria-current="page"attribute - Separators are decorative and hidden from screen readers
- Links have proper focus styles with visible ring
Styling
- Current page (last item) is displayed in
foregroundcolor with medium font weight - Interactive links are in
muted-foregroundwith hover transitions - Separators are in
muted-foregroundand non-selectable - Responsive layout with flex wrap for narrow viewports