Breadcrumb A navigation trail ending at the current page. For a single link back, use a Link with a ChevronToArrow .
Installation bun add @harmo-ui/css @harmo-ui/react npm install @harmo-ui/css @harmo-ui/react pnpm add @harmo-ui/css @harmo-ui/react yarn add @harmo-ui/css @harmo-ui/react bunx harmo-ui add breadcrumb npx harmo-ui add breadcrumb pnpm dlx harmo-ui add breadcrumb yarn dlx harmo-ui add breadcrumb Usage import { Breadcrumb , Link } from "@harmo-ui/react" ;
< Breadcrumb aria-label = "Breadcrumb" >
< Link href = "/settings" >Settings</ Link >
< Link href = "/settings/users" >Users</ Link >
Jane Smith
</ Breadcrumb > Examples Trail A <nav> named "Breadcrumb" around an ordered list, so screen readers announce the trail and its length. Every item after the first starts with a separator, hidden from screen readers, and the last is marked aria-current="page".
< Breadcrumb aria-label = "Breadcrumb" >
< Link href = "/settings" >Settings</ Link >
< Link href = "/settings/users" >Users</ Link >
Jane Smith
</ Breadcrumb > < nav class = "hbreadcrumb" aria-label = "Breadcrumb" >
< ol >
< li >< a class = "hlink" href = "/settings" >Settings</ a ></ li >
< li >
< svg class = "hbreadcrumb-separator hchevron" width = "24" height = "24" viewBox = "0 0 24 24" fill = "none" aria-hidden = "true" focusable = "false" >
< path
d = "M8.79048 5C8.58956 5 8.38863 5.07186 8.23001 5.22585C7.92333 5.52355 7.92333 6.01631 8.23001 6.31402L14.0886 12.0013L8.23001 17.6885C7.92333 17.9863 7.92333 18.479 8.23001 18.7767C8.53668 19.0744 9.04428 19.0744 9.35096 18.7767L15.77 12.5454C16.0767 12.2477 16.0767 11.7549 15.77 11.4572L9.35096 5.22585C9.19233 5.07186 8.99141 5 8.79048 5Z"
fill = "currentColor"
/>
</ svg >
< a class = "hlink" href = "/settings/users" >Users</ a >
</ li >
< li >
< svg class = "hbreadcrumb-separator hchevron" width = "24" height = "24" viewBox = "0 0 24 24" fill = "none" aria-hidden = "true" focusable = "false" >
< path
d = "M8.79048 5C8.58956 5 8.38863 5.07186 8.23001 5.22585C7.92333 5.52355 7.92333 6.01631 8.23001 6.31402L14.0886 12.0013L8.23001 17.6885C7.92333 17.9863 7.92333 18.479 8.23001 18.7767C8.53668 19.0744 9.04428 19.0744 9.35096 18.7767L15.77 12.5454C16.0767 12.2477 16.0767 11.7549 15.77 11.4572L9.35096 5.22585C9.19233 5.07186 8.99141 5 8.79048 5Z"
fill = "currentColor"
/>
</ svg >
< span aria-current = "page" >Jane Smith</ span >
</ li >
</ ol >
</ nav >
View full source
Right to left The same trail in Arabic: the separators point left, in the reading direction.
< Breadcrumb aria-label = "Breadcrumb" >
< Link href = "/settings" >الإعدادات</ Link >
< Link href = "/settings/users" >المستخدمون</ Link >
جين سميث
</ Breadcrumb > < nav class = "hbreadcrumb" aria-label = "Breadcrumb" >
< ol >
< li >< a class = "hlink" href = "/settings" >الإعدادات</ a ></ li >
< li >
< svg class = "hbreadcrumb-separator hchevron" width = "24" height = "24" viewBox = "0 0 24 24" fill = "none" aria-hidden = "true" focusable = "false" >
< path
d = "M8.79048 5C8.58956 5 8.38863 5.07186 8.23001 5.22585C7.92333 5.52355 7.92333 6.01631 8.23001 6.31402L14.0886 12.0013L8.23001 17.6885C7.92333 17.9863 7.92333 18.479 8.23001 18.7767C8.53668 19.0744 9.04428 19.0744 9.35096 18.7767L15.77 12.5454C16.0767 12.2477 16.0767 11.7549 15.77 11.4572L9.35096 5.22585C9.19233 5.07186 8.99141 5 8.79048 5Z"
fill = "currentColor"
/>
</ svg >
< a class = "hlink" href = "/settings/users" >المستخدمون</ a >
</ li >
< li >
< svg class = "hbreadcrumb-separator hchevron" width = "24" height = "24" viewBox = "0 0 24 24" fill = "none" aria-hidden = "true" focusable = "false" >
< path
d = "M8.79048 5C8.58956 5 8.38863 5.07186 8.23001 5.22585C7.92333 5.52355 7.92333 6.01631 8.23001 6.31402L14.0886 12.0013L8.23001 17.6885C7.92333 17.9863 7.92333 18.479 8.23001 18.7767C8.53668 19.0744 9.04428 19.0744 9.35096 18.7767L15.77 12.5454C16.0767 12.2477 16.0767 11.7549 15.77 11.4572L9.35096 5.22585C9.19233 5.07186 8.99141 5 8.79048 5Z"
fill = "currentColor"
/>
</ svg >
< span aria-current = "page" >جين سميث</ span >
</ li >
</ ol >
</ nav >
View full source
Long trail In a narrow container, drawn dashed here, the trail wraps onto more lines, and a long item wraps within itself.
< Breadcrumb aria-label = "Breadcrumb" >
< Link href = "/settings" >Settings</ Link >
< Link href = "/settings/channels" >Channels</ Link >
< Link href = "/settings/channels/whatsapp" >WhatsApp</ Link >
Order shipped notification template
</ Breadcrumb > < nav class = "hbreadcrumb" aria-label = "Breadcrumb" >
< ol >
< li >< a class = "hlink" href = "/settings" >Settings</ a ></ li >
< li >
< svg class = "hbreadcrumb-separator hchevron" width = "24" height = "24" viewBox = "0 0 24 24" fill = "none" aria-hidden = "true" focusable = "false" >
< path
d = "M8.79048 5C8.58956 5 8.38863 5.07186 8.23001 5.22585C7.92333 5.52355 7.92333 6.01631 8.23001 6.31402L14.0886 12.0013L8.23001 17.6885C7.92333 17.9863 7.92333 18.479 8.23001 18.7767C8.53668 19.0744 9.04428 19.0744 9.35096 18.7767L15.77 12.5454C16.0767 12.2477 16.0767 11.7549 15.77 11.4572L9.35096 5.22585C9.19233 5.07186 8.99141 5 8.79048 5Z"
fill = "currentColor"
/>
</ svg >
< a class = "hlink" href = "/settings/channels" >Channels</ a >
</ li >
< li >
< svg class = "hbreadcrumb-separator hchevron" width = "24" height = "24" viewBox = "0 0 24 24" fill = "none" aria-hidden = "true" focusable = "false" >
< path
d = "M8.79048 5C8.58956 5 8.38863 5.07186 8.23001 5.22585C7.92333 5.52355 7.92333 6.01631 8.23001 6.31402L14.0886 12.0013L8.23001 17.6885C7.92333 17.9863 7.92333 18.479 8.23001 18.7767C8.53668 19.0744 9.04428 19.0744 9.35096 18.7767L15.77 12.5454C16.0767 12.2477 16.0767 11.7549 15.77 11.4572L9.35096 5.22585C9.19233 5.07186 8.99141 5 8.79048 5Z"
fill = "currentColor"
/>
</ svg >
< a class = "hlink" href = "/settings/channels/whatsapp" >WhatsApp</ a >
</ li >
< li >
< svg class = "hbreadcrumb-separator hchevron" width = "24" height = "24" viewBox = "0 0 24 24" fill = "none" aria-hidden = "true" focusable = "false" >
< path
d = "M8.79048 5C8.58956 5 8.38863 5.07186 8.23001 5.22585C7.92333 5.52355 7.92333 6.01631 8.23001 6.31402L14.0886 12.0013L8.23001 17.6885C7.92333 17.9863 7.92333 18.479 8.23001 18.7767C8.53668 19.0744 9.04428 19.0744 9.35096 18.7767L15.77 12.5454C16.0767 12.2477 16.0767 11.7549 15.77 11.4572L9.35096 5.22585C9.19233 5.07186 8.99141 5 8.79048 5Z"
fill = "currentColor"
/>
</ svg >
< span aria-current = "page" >Order shipped notification template</ span >
</ li >
</ ol >
</ nav >
View full source
API reference React <Breadcrumb> renders the trail from its children, one item each, in order: it adds the separators and marks the last item as the current page. Name it with aria-label, which is required, such as "Breadcrumb". Other props are the <nav>'s attributes. To hide an item, leave it out: hidden on a child would leave its separator behind.
HTML A <nav class="hbreadcrumb"> around an <ol>, with an aria-label in the page's language. Every item after the first starts with a .hbreadcrumb-separator (with .hchevron), which has aria-hidden="true" and focusable="false", and the last item has aria-current="page". Load breadcrumb.css, link.css, and chevron.css. It needs no script.
See Breadcrumb's full contract .
Accessibility A <nav> with aria-label="Breadcrumb" holding an ordered list, so screen readers announce the trail and its length. The last item is marked aria-current="page". Separators are aria-hidden, so they aren't read between items.