Skip to content
Vertical Jump Designs-uiFront-End Studio
Get Pro

v3.9 is out.

Navigation

Breadcrumbs

Free15.3 KB gzipped

A trail of links showing where the current page sits in the site hierarchy. Compose with Breadcrumbs.Item.

Accessibility: WCAG 2.2 AA · No A or AA violations in light or dark mode · Keys: Tab · Full report

Import

tsx
import { Breadcrumbs } from "@vjdesigns/vjdesigns-ui";

Importing only Breadcrumbs adds about 15.3 KB of minified, gzipped JavaScript to your app (React not included). The stylesheet is shared by every component and loaded once: 75.1 KB gzipped.

Examples

Basic

The last item is the current page: it gets aria-current="page" and isn't a link.

tsx
import { Breadcrumbs, HomeIcon } from "@vjdesigns/vjdesigns-ui";

export function Basic() {
  return (
    <Breadcrumbs>
      <Breadcrumbs.Item href="#example-basic" icon={<HomeIcon />}>
        Home
      </Breadcrumbs.Item>
      <Breadcrumbs.Item href="#example-basic">Projects</Breadcrumbs.Item>
      <Breadcrumbs.Item href="#example-basic">Spring launch</Breadcrumbs.Item>
      <Breadcrumbs.Item>Settings</Breadcrumbs.Item>
    </Breadcrumbs>
  );
}

Collapsed

Past maxItems, the middle collapses into a button that expands the full trail.

tsx
import { Breadcrumbs } from "@vjdesigns/vjdesigns-ui";

export function Collapsed() {
  return (
    <Breadcrumbs maxItems={4} itemsBeforeCollapse={1} itemsAfterCollapse={2} size="sm">
      <Breadcrumbs.Item href="#example-collapsed">Home</Breadcrumbs.Item>
      <Breadcrumbs.Item href="#example-collapsed">Clothing</Breadcrumbs.Item>
      <Breadcrumbs.Item href="#example-collapsed">Men</Breadcrumbs.Item>
      <Breadcrumbs.Item href="#example-collapsed">Shoes</Breadcrumbs.Item>
      <Breadcrumbs.Item href="#example-collapsed">Running</Breadcrumbs.Item>
      <Breadcrumbs.Item>Trail runners</Breadcrumbs.Item>
    </Breadcrumbs>
  );
}

Accessibility

Breadcrumbs are a navigation landmark named by aria-label, and the last item is marked aria-current="page". With maxItems, the middle levels collapse into a named "show more" button that keyboard and screen reader users can open.

tsx
import { Breadcrumbs, HomeIcon } from "@vjdesigns/vjdesigns-ui";

export function Accessibility() {
  return (
    <Breadcrumbs aria-label="Breadcrumb" maxItems={3}>
      <Breadcrumbs.Item href="#example-accessibility" icon={<HomeIcon />}>
        Home
      </Breadcrumbs.Item>
      <Breadcrumbs.Item href="#example-accessibility">Shop</Breadcrumbs.Item>
      <Breadcrumbs.Item href="#example-accessibility">Shoes</Breadcrumbs.Item>
      <Breadcrumbs.Item href="#example-accessibility">Running</Breadcrumbs.Item>
      <Breadcrumbs.Item current>Trail runners</Breadcrumbs.Item>
    </Breadcrumbs>
  );
}

Translated

The collapse button's name comes from the locale (Japanese here). Translate the landmark's aria-label and the item labels yourself.

tsx
import { Breadcrumbs, LocaleProvider } from "@vjdesigns/vjdesigns-ui";
import ja from "@vjdesigns/vjdesigns-ui/locales/ja";

export function Translated() {
  return (
    <LocaleProvider locale="ja" messages={ja}>
      <Breadcrumbs aria-label="現在地" maxItems={3}>
        <Breadcrumbs.Item href="#example-translated">ホーム</Breadcrumbs.Item>
        <Breadcrumbs.Item href="#example-translated">ショップ</Breadcrumbs.Item>
        <Breadcrumbs.Item href="#example-translated">靴</Breadcrumbs.Item>
        <Breadcrumbs.Item current>ランニングシューズ</Breadcrumbs.Item>
      </Breadcrumbs>
    </LocaleProvider>
  );
}

Right to left

The first example again, inside a right-to-left LocaleProvider (Arabic). Layout, spacing and arrow icons mirror, and the components' built-in text is translated. The example's own text stays in English.

Basic

tsx
import { LocaleProvider } from "@vjdesigns/vjdesigns-ui";
import ar from "@vjdesigns/vjdesigns-ui/locales/ar";

// Basic is the "Basic" example above.
<LocaleProvider locale="ar" messages={ar}>
  <Basic />
</LocaleProvider>

API reference

Breadcrumbs

Breadcrumbs props
PropTypeDefault
children

Breadcrumbs.Item elements, from the top of the hierarchy to the current page.

ReactNode—
aria-label

Accessible name of the <nav> landmark. Localize it here.

string"Breadcrumb"
size

Type size, spacing, and separator size.

"sm""md""lg""md"
separator

Decorative separator shown between items (e.g. "/" or an icon). It is hidden from assistive technology. Defaults to a chevron that flips in RTL.

ReactNode—
linkAs

Component used for every item's link, such as a React Router or Next.js Link. Items can override it with their own as. Pass router-only props (like to) through each item's linkProps. The component must forward className, ref, and ARIA props to its <a>.

ElementType—
maxItems

When there are more items than this, the middle ones collapse into a "show more" button. Leave unset to never collapse.

number—
itemsBeforeCollapse

Items kept visible before the collapsed group.

number1
itemsAfterCollapse

Items kept visible after the collapsed group. Values below 1 are treated as 1, so the current page stays visible.

number1
expanded

Controlled expanded state of a collapsed trail.

boolean—
defaultExpanded

Initial expanded state when uncontrolled.

booleanfalse
onExpandedChange

Called with the new expanded state when the collapsed items are revealed.

(expanded: boolean) => void—
expandLabel

Accessible name of the expand button, given the number of hidden items. Localize it here.

(hiddenCount: number) => string(n) => `Show ${n} more breadcrumbs`

Also accepts native <nav> attributes, plus className, style and ref.

Breadcrumbs.Item

One step in the trail. See BreadcrumbItem.

Breadcrumbs.Item props
PropTypeDefault
children

The visible label.

ReactNode—
aria-label

Overrides the accessible name. Usually unnecessary when there is a visible label.

string—
href

Destination URL. Omit it (and linkProps) for a crumb that isn't a page.

string—
as

Component used for this item's link, such as a router Link. Overrides the linkAs set on Breadcrumbs. Pass its own props (e.g. to) through linkProps.

ElementType—
linkProps

Extra props for the link element, typed for as (e.g. { to: "/teams" } for React Router). Setting it makes a non-current item a link even without href. With linkAs set once on Breadcrumbs, give the item the component as a type argument so these props are typed for it too: <Breadcrumbs.Item<typeof RouterLink> linkProps={{ to: "/teams" }}>.

Partial<Omit<ComponentPropsWithRef<C>, "children" | "className">>—
icon

Icon before the label (e.g. <HomeIcon />). Decorative; it scales with the text.

ReactNode—
current

Marks this item as the current page: it renders as text with aria-current="page" instead of a link. Defaults to true for the last item only.

boolean—
title

Tooltip text. When a label truncates, its full text is shown as a tooltip automatically.

string—

Also accepts native <li> attributes, plus className, style and ref.

See what changed in each version in the Changelog.

Accessibility report

Breadcrumbs targets WCAG 2.2 AA. Below: a live axe-core audit of this page's examples, Lighthouse scores for the page in both modes, the accessibility behavior built into the component, and the checks only a person can do.

axe-core audit (live)

Running accessibility audit

Checking the examples above…

Lighthouse audit

Light mode

Score 100

35 passed · 0 failed · 30 not applicable · 10 to check by hand

Dark mode

Score 100

35 passed · 0 failed · 30 not applicable · 10 to check by hand

Lighthouse 13.5.0 audits the whole docs page (header and sidebar included), not just the examples, in English. Last run 11/27/2026. Some failed audits carry no weight in the score, so a page can score 100 and still list one.

Built-in behavior

Keyboard

Keyboard
KeyAction
TabMoves through the links. The current page isn't a link.

Roles and states

Roles and states
ElementRoleStates and properties
<nav>navigationaria-label ("Breadcrumb")
<ol>list—
Current pagenonearia-current="page"
Separatorsnonearia-hidden="true"

Manual checks

Automated tools find roughly a third of accessibility issues. Test these in your app, with your content.

Manual accessibility checks
CheckWhat to testWCAG 2.2
KeyboardEvery action works with Tab, Shift+Tab, Enter, Space and the arrow keys, and focus never gets stuck.2.1.1 (A), 2.1.2 (A)
FocusFocus moves in a logical order, is always visible, and isn't hidden behind sticky headers.2.4.3 (A), 2.4.7 (AA), 2.4.11 (AA), 2.4.13 (AAA)
Screen readersNames, roles and states are announced correctly, and status changes are announced without moving focus.1.3.1 (A), 4.1.2 (A), 4.1.3 (AA)
ColorMeaning never depends on color alone; your own colors meet contrast in both modes.1.4.1 (A), 1.4.3 (AA), 1.4.11 (AA), 1.4.6 (AAA)
Zoom and reflowAt 200% text size and at 320px wide (400% zoom), nothing is cut off and no sideways scrolling is needed.1.4.4 (AA), 1.4.10 (AA), 1.4.12 (AA)
Pointer targetsClick and tap targets are at least 24×24px (44×44px for AAA), or spaced so they don't overlap.2.5.8 (AA), 2.5.5 (AAA)
MotionAnimations respect the reduced-motion setting.2.3.3 (AAA)