Structure
The Breadcrumb component consists of three subcomponents:Breadcrumb.Root- The container for the breadcrumb navigationBreadcrumb.Item- Individual navigation items (typically links)Breadcrumb.Separator- Visual separator between items
Import
Usage
Basic Breadcrumb
Multi-level Navigation
Custom Separator
With Icon Separator
Using Different Elements
API Reference
Breadcrumb.Root
The container component that wraps all breadcrumb items and separators.The HTML element type to render.
Additional CSS classes to apply. Default styles include flex layout and border styling.
The breadcrumb items and separators to display.
Breadcrumb.Item
An individual breadcrumb item, typically rendered as a link.The URL to navigate to when the item is clicked. If empty and
as is 'a', the item will still render as a link but won’t navigate anywhere.The HTML element type to render (e.g.,
'a', 'button', 'span').Additional CSS classes to apply. Default styles include text color transitions and hover effects.
The content to display inside the breadcrumb item.
Breadcrumb.Separator
A visual separator between breadcrumb items.The HTML element type to render.
Additional CSS classes to apply. Default styles include muted text color.
The separator content. If no children are provided, defaults to
/.Styling
The Breadcrumb component uses the following preset keys for styling:breadcrumb- Applied to the root containerbreadcrumb.item- Applied to each breadcrumb itembreadcrumb.separator- Applied to each separator
- Using the
classprop to add custom classes - Defining custom styles for the preset keys in your theme
- Using the
$presetclass placeholder in your styles
Default Styles
Root: Flex container with nowrap, items centered, gap spacing, and border styling. Item: Muted text color that brightens on hover, rounded corners, padding, and smooth transitions. Separator: Muted text color with reduced opacity, minimal padding.Accessibility
- The breadcrumb navigation should be wrapped in a
<nav>element witharia-label="Breadcrumb"for screen readers - The current page item should have
aria-current="page"attribute - Use semantic HTML elements (
<a>for links,<span>for current page)