Breadcrumb
freeBreadcrumb keeps nested routes visible so people can move back through the current context.
Installation
Add this component with the NateUI CLI.
Examples
Basic
Compound
Collapsed
Separator
Icons
States
Router Adapter
API
Breadcrumb can render from an items array or from its compound parts. The array form handles current-page detection, disabled crumbs, separators, link adapters, and collapsed middle items.
Breadcrumb
| Prop | Description | Type | Default |
|---|---|---|---|
children | Compound breadcrumb content rendered when items is not provided. | ReactNode | - |
className | Class names applied to the root nav. | string | - |
classNames | Slot class names for the root-generated list, items, links, page, separator, ellipsis, and icons. | BreadcrumbSlotClassNames | - |
ellipsisLabel | Screen-reader label for the collapsed ellipsis item. | string | 'More pages' |
items | Data used to render the breadcrumb list automatically. | BreadcrumbItemData[] | - |
itemsAfterCollapse | Number of trailing items kept visible when maxItems collapses the middle. | number | 1 |
itemsBeforeCollapse | Number of leading items kept visible when maxItems collapses the middle. | number | 1 |
maxItems | Maximum visible item count before the middle of the trail is replaced by an ellipsis. Values below 3 disable collapsing. | number | - |
ref | Ref forwarded to the root nav. | Ref<HTMLElement> | - |
renderLink | Link renderer used for generated link crumbs unless an individual item supplies its own render. | LinkRenderer | - |
separator | Separator rendered between generated items. Can be a node or a renderer that receives the item index. | ReactNode | BreadcrumbSeparatorRenderer | Chevron based on direction |
...nativeProps | Native nav props forwarded to the root element. | ComponentPropsWithRef<'nav'> | - |
Breadcrumb.List
| Prop | Description | Type | Default |
|---|---|---|---|
children | Breadcrumb item nodes. | ReactNode | - |
className | Class names applied to the ordered list. | string | - |
ref | Ref forwarded to the ol. | Ref<HTMLOListElement> | - |
...nativeProps | Native ordered-list props forwarded to the list. | ComponentPropsWithRef<'ol'> | - |
Breadcrumb.Item
| Prop | Description | Type | Default |
|---|---|---|---|
children | Link, page, separator, or custom breadcrumb content. | ReactNode | - |
className | Class names applied to the item wrapper. | string | - |
ref | Ref forwarded to the li. | Ref<HTMLLIElement> | - |
...nativeProps | Native list-item props forwarded to the item. | ComponentPropsWithRef<'li'> | - |
Breadcrumb.Link
| Prop | Description | Type | Default |
|---|---|---|---|
children | Link label. | ReactNode | - |
className | Class names applied to the link. | string | - |
href | Destination URL. Required for link crumbs. | string | - |
icon | Icon node rendered before the label. | ReactNode | - |
iconClassName | Class names applied to the icon wrapper. | string | - |
ref | Ref forwarded to the rendered anchor or adapter component. | Ref<HTMLAnchorElement> | - |
render | Element or component used instead of the default anchor. | LinkRenderer | - |
...nativeProps | Native anchor props forwarded to the rendered link, excluding href. | Omit<ComponentPropsWithRef<'a'>, 'href'> | - |
Breadcrumb.Page
| Prop | Description | Type | Default |
|---|---|---|---|
children | Current page label. | ReactNode | - |
className | Class names applied to the page label. | string | - |
current | Whether to set aria-current="page" on the label. | boolean | true |
icon | Icon node rendered before the label. | ReactNode | - |
iconClassName | Class names applied to the icon wrapper. | string | - |
ref | Ref forwarded to the span. | Ref<HTMLSpanElement> | - |
...nativeProps | Native span props forwarded to the page label. | ComponentPropsWithRef<'span'> | - |
Breadcrumb.Separator
| Prop | Description | Type | Default |
|---|---|---|---|
children | Custom separator content. Takes precedence over separator. | ReactNode | - |
className | Class names applied to the separator. | string | - |
ref | Ref forwarded to the separator span. | Ref<HTMLSpanElement> | - |
separator | Separator content rendered when children is not provided. | ReactNode | Direction-aware chevron |
...nativeProps | Native span props forwarded to the separator. | ComponentPropsWithRef<'span'> | - |
Breadcrumb.Ellipsis
| Prop | Description | Type | Default |
|---|---|---|---|
children | Custom ellipsis content. Defaults to the internal dots icon. | ReactNode | - |
className | Class names applied to the ellipsis wrapper. | string | - |
label | Screen-reader label for the collapsed crumb control. | string | 'More pages' |
ref | Ref forwarded to the ellipsis span. | Ref<HTMLSpanElement> | - |
...nativeProps | Native span props forwarded to the ellipsis. | ComponentPropsWithRef<'span'> | - |