Breadcrumb
An accessible breadcrumb navigation component that helps users understand their location in the site hierarchy. Uses proper ARIA markup and semantic HTML.
Basic Usage
Breadcrumbs show the current page location in the navigation hierarchy.
import { AccessibleBreadcrumb } from '@a13y/react';
const items = [
{ label: 'Home', href: '/' },
{ label: 'Products', href: '/products' },
{ label: 'Electronics', href: '/products/electronics' },
{ label: 'Laptop' }
];
function Example() {
return <AccessibleBreadcrumb items={items} />;
}Breadcrumb Props
| Name | Type | Default | Description |
|---|---|---|---|
items* | BreadcrumbItem[] | - | Array of breadcrumb items with label and optional href |
separator | ReactNode | "/" | Custom separator between breadcrumb items |
className | string | - | Optional CSS class for the breadcrumb container |
BreadcrumbItem Props
| Name | Type | Default | Description |
|---|---|---|---|
label* | string | - | Text to display for the breadcrumb item |
href | string | - | URL for the breadcrumb link (omit for current page) |
Accessibility Features
- ✓Uses
navelement witharia-label="Breadcrumb" - ✓Current page marked with
aria-current="page" - ✓Semantic ordered list structure
- ✓Clear visual distinction between links and current page