Skip to content

shadcn.io is an independent project built on shadcn/ui

Components

Free

Breadcrumb for Ark UI

A breadcrumb trail for React on Ark UI: links up through a page's parents, ending in the current page as text, with ellipsis and menu variants.

On this page9 sections

A breadcrumb shows where a page sits in a site, as a trail of links from the home page down through its parents, ending in the current page as plain text. It earns its place on deep pages, a product inside a category or a setting three levels into an admin, where people want to step back up.

It doesn't replace the site's main navigation, which belongs in a Navigation Menu or a Sidebar.

Preview width

Installation

Sign in to get your install command
Free with an account. It carries your token, so the CLI installs everything in one go.

Anatomy

Breadcrumb anatomy: link, ellipsis, separator, item, page

Usage

import {
  Breadcrumb, BreadcrumbItem, BreadcrumbLink, BreadcrumbList,
  BreadcrumbPage, BreadcrumbSeparator,
} from "@/components/ui/breadcrumb";

End the trail with BreadcrumbPage rather than a link, since the current page is somewhere the reader already is.

<Breadcrumb>
  <BreadcrumbList>
    <BreadcrumbItem>
      <BreadcrumbLink href="/">Home</BreadcrumbLink>
    </BreadcrumbItem>
    <BreadcrumbSeparator />
    <BreadcrumbItem>
      <BreadcrumbLink href="/docs/components">Components</BreadcrumbLink>
    </BreadcrumbItem>
    <BreadcrumbSeparator />
    <BreadcrumbItem>
      <BreadcrumbPage>Breadcrumb</BreadcrumbPage>
    </BreadcrumbItem>
  </BreadcrumbList>
</Breadcrumb>

Accessibility

Breadcrumb renders a nav landmark named breadcrumb, and the trail inside it is an ordered list, so a screen reader can say how many levels deep the page is. The links are ordinary anchors in the tab order, with no keys of their own beyond Enter to follow one. Separators and BreadcrumbEllipsis are hidden from screen readers.

BreadcrumbPage marks the end of the trail with aria-current="page" and stays out of the tab order. The landmark's name is the English word breadcrumb, so pass a translated aria-label to Breadcrumb on a page in another language.

Demos

Basic

Home and Components are links, and Breadcrumb, the page you're on, sits at the end as text, with the default chevron between them. This is the shape for any trail short enough to show whole, which covers most of them. Reach for the variants below only when the path is deep or the levels need menus.

Preview width

Separator

A dot icon replaces the chevron, passed as the child of each BreadcrumbSeparator. The separator stays hidden from screen readers whatever it holds, since the list already gives the order. Use it when a chevron reads too heavy for the page or the product has a mark of its own, and keep one mark across the site.

Preview width

The middle level, Components, is a button that opens a menu of Documentation, Themes and GitHub. It's an ordinary menu placed inside a BreadcrumbItem rather than a breadcrumb part, so any menu component works there. Use it when a level has siblings people often jump between, such as the other sections under one parent.

Preview width

Ellipsis

Between Home and Components, BreadcrumbEllipsis stands in for the levels that don't fit. It is a mark, not a control: nothing opens when it's clicked, and screen readers skip it. Use it when the start and the end of a deep trail matter most, and switch to the Dropdown menu when people need the hidden levels.

Preview width

Home and Components are Next.js Link components rendered through asChild on BreadcrumbLink, so a click routes on the client instead of loading a new page. Use this in any app with its own router. The current page stays BreadcrumbPage text either way.

Preview width

RTL

The trail in Arabic, with dir set to rtl on Breadcrumb, so it starts at the right: the home link, a menu of sibling pages, then the current page. The list is a flex row, so the order follows the reading direction with nothing else to set. Use it for an Arabic or Hebrew interface.

Preview width

FAQ

How do I mark the current page in a Breadcrumb?

End the trail with BreadcrumbPage instead of a link. It renders the page's name as text with aria-current="page", so a screen reader announces it as the current page, and it stays out of the tab order. A link to the page someone is already on would only reload it.

How do I build a Breadcrumb from the current URL?

Split the path into segments and make one level per segment, each linking to the path up to that point, so /docs/components/breadcrumb gives Docs, Components and Breadcrumb after Home. Render every level but the last as a BreadcrumbLink, the last as BreadcrumbPage, and put a BreadcrumbSeparator between each pair.

A segment makes a poor label on its own, since a slug or an id is not a page title. Keep a map from each path to its title, or let each route export one, and fall back to the segment only where nothing is set.

How do I change the Breadcrumb separator to a slash?

Put the mark you want inside BreadcrumbSeparator, which shows its chevron only while it's empty. A slash icon, a dot as in the Separator demo, or a plain slash character all work, and the separator stays hidden from screen readers whatever it holds. Use the same mark on every page.

How do I shorten a long Breadcrumb on mobile?

Keep the first item and the current page, and collapse the levels between them. A BreadcrumbEllipsis marks the gap, as in the Ellipsis demo, and a menu of the hidden levels keeps them in reach, as in the Dropdown demo. Screen readers skip the ellipsis, so prefer the menu when those levels matter.

To collapse only on small screens, hide the middle items and their separators below a breakpoint with a class such as hidden md:inline-flex. Without that, the list wraps onto a second line rather than overflowing.

Do I need a Breadcrumb if my page has a back button?

They answer different questions. A back button follows the reader's own history, while a breadcrumb shows where the page sits in your site, whatever the route that led there.

Someone who lands on a product page from a search result has no history to go back to, but can still climb the trail to the category or the home page. Keep both when the page is deep enough to need a trail.

Does the Ark UI Breadcrumb support right-to-left languages?

It does. Set dir to rtl on Breadcrumb or any element above it, and the trail starts at the right, as the RTL demo shows. The default chevron turns to point left with it, through an rtl: class on the icon.

A separator of your own doesn't turn by itself. Pick one that reads the same both ways, such as a dot, or add rtl:rotate-180 to an arrow.

Does a Breadcrumb help SEO, and do I need structured data?

It gives crawlers the same hierarchy it gives people: a link from each page to every level above it. The component renders only that visible trail, with no structured data.

To hand search engines the trail as data, add a JSON-LD script with the schema.org BreadcrumbList type next to it, one entry per level with its name and URL. Despite the shared name, that is a separate script tag, not the component's list part.

API Reference

<nav> data-slot="breadcrumb"

PropType
asChild?boolean

Use the provided child element as the default rendered element, combining their props and behavior.

className?string

Merged with the part's classes.

<ol> data-slot="breadcrumb-list"

PropType
asChild?boolean

Use the provided child element as the default rendered element, combining their props and behavior.

className?string

Merged with the part's classes.

<li> data-slot="breadcrumb-item"

PropType
asChild?boolean

Use the provided child element as the default rendered element, combining their props and behavior.

className?string

Merged with the part's classes.

<a> data-slot="breadcrumb-link"

PropType
asChild?boolean

Use the provided child element as the default rendered element, combining their props and behavior.

className?string

Merged with the part's classes.

<span> data-slot="breadcrumb-page"

PropType
asChild?boolean

Use the provided child element as the default rendered element, combining their props and behavior.

className?string

Merged with the part's classes.

<li> data-slot="breadcrumb-separator"

PropType
asChild?boolean

Use the provided child element as the default rendered element, combining their props and behavior.

className?string

Merged with the part's classes.

<span> data-slot="breadcrumb-ellipsis"

PropType
asChild?boolean

Use the provided child element as the default rendered element, combining their props and behavior.

className?string

Merged with the part's classes.