Breadcrumb
A trail of links to the current page that wraps safely, mirrors in right-to-left layouts and expands collapsed segments in place.
- Navigation components
- 8 parts
- 10 examples
@base-ui/react@tabler/icons-react
See it in a real product: Commerce Dashboard, Product Editor, and Storefront
View blockpnpm dlx shadcn@latest add https://hextaui.com/r/breadcrumb.jsonAdds the component, the HextaUI theme tokens and any HextaUI components it depends on.
Add the theme tokens to your global CSS, if you haven’t yet.
Install the dependencies.
pnpm add @base-ui/react @tabler/icons-react cnCopy and paste the following code into your project.
components/ui/breadcrumb.tsx lib/motion.ts Update the import paths to match your project setup.
Icons sit inside links and the current page. Give an icon-only link an aria-label.
Pass any element as children of <BreadcrumbSeparator /> to replace the chevron.
Render a <BreadcrumbLink /> as the trigger of a <DropdownMenu /> to offer sibling pages.
Wrap middle segments in <BreadcrumbCollapse />. They hide behind an ellipsis and slide open in place, and focus moves to the first revealed link. Pass open and onOpenChange to control it.
A static <BreadcrumbEllipsis /> marks skipped levels. It is hidden from assistive tech unless you make it interactive.
Use the render prop to swap the anchor for your router's link, like Next.js <Link />.
Unbroken names wrap instead of overflowing, and segments with a max width truncate.
Separators flip and the collapse animates from the correct side.
Links and the collapse button are regular tab stops. Separators and a static ellipsis are skipped.
| Key | Action |
|---|---|
| TabShift + Tab | Moves between links and the collapse button. |
| Enter | Follows the focused link. |
| EnterSpace | On the collapse button, reveals the hidden segments. Once they finish sliding open, focus moves to the first revealed link. |
Every part accepts the attributes of the element it renders, plus a render prop to swap that element.
| Prop | Type | Default |
|---|---|---|
renderLabelled “Breadcrumb” for assistive tech. | ReactElement | (props, state) => ReactElement | <nav> |
| Attribute | Description |
|---|---|
data-slot="breadcrumb" | The <nav> landmark. |
| Prop | Type | Default |
|---|---|---|
render | ReactElement | (props, state) => ReactElement | <ol> |
| Attribute | Description |
|---|---|
data-slot="breadcrumb-list" | The ordered list. Items wrap onto new lines when space runs out. |
| Prop | Type | Default |
|---|---|---|
render | ReactElement | (props, state) => ReactElement | <li> |
| Attribute | Description |
|---|---|
data-slot="breadcrumb-item" | Target items in CSS. |
data-collapsed | Present while the item is hidden inside a closed BreadcrumbCollapse. |
data-breadcrumb-group | Present on items inside a BreadcrumbCollapse. Shared by every part of the same group. |
| Prop | Type | Default |
|---|---|---|
href | string | – |
renderPass your router’s link component here. | ReactElement | (props, state) => ReactElement | <a> |
| Attribute | Description |
|---|---|
data-slot="breadcrumb-link" | Target links in CSS. |
| Prop | Type | Default |
|---|---|---|
renderMarked with aria-current="page". | ReactElement | (props, state) => ReactElement | <span> |
| Attribute | Description |
|---|---|
data-slot="breadcrumb-page" | The current page, with aria-current="page". |
| Prop | Type | Default |
|---|---|---|
childrenMirrors automatically in right-to-left layouts. | ReactNode | <IconChevronRight /> |
render | ReactElement | (props, state) => ReactElement | <li> |
| Attribute | Description |
|---|---|
data-slot="breadcrumb-separator" | Presentational and hidden from assistive tech. |
data-collapsed | Present while the separator is hidden inside a closed BreadcrumbCollapse. |
data-breadcrumb-group | Present on separators inside a BreadcrumbCollapse. |
| Prop | Type | Default |
|---|---|---|
children | ReactNode | <IconDots /> |
renderHidden from assistive tech unless render or onClick makes it interactive. | ReactElement | (props, state) => ReactElement | <span> |
| Attribute | Description |
|---|---|
data-slot="breadcrumb-ellipsis" | Target the ellipsis in CSS. |
| Prop | Type | Default |
|---|---|---|
childrenThe items and separators to hide behind the ellipsis. | ReactNode | – |
open | boolean | – |
defaultOpen | boolean | false |
onOpenChange | (open: boolean) => void | – |
labelAccessible name of the ellipsis button. | string | "Show full path" |
| Attribute | Description |
|---|---|
data-slot="breadcrumb-collapse" | The <li> that holds the ellipsis button. |
data-collapsed | Present on the ellipsis item once the group has opened, which hides it. |
- MotionThe easing curves, durations and reduced-motion check every component animates with, plus hooks for size morphs and sliding highlights.
- Navigation menuSite navigation with dropdowns, or one full-width panel that stays open while its content slides between menus.
- PaginationPage navigation that keeps every button in place, glides to the current page and jumps to any page from the ellipsis.
- SidebarAn app sidebar that collapses to icons or off canvas, stays pinned under your header, and becomes a swipeable sheet on phones.
- TabsSwitch between views with an indicator that slides to the active tab, as a segmented control or an underline, and lists that scroll when they overflow.
Used in Pro blocks
Blocks that build on Breadcrumb.
Every block comes with HextaUI Pro, and Prompt Input is free.