Todae

Todae

Breadcrumbs

The trail of pages above the current one. Breadcrumbs.Root is a nav landmark around an ordered list, and each Breadcrumbs.Item is a list item. Put a link in each item, such as an a or your router's link, and plain text in the last one, marked current, which wraps that text in a span with aria-current="page".

On this page
import { Breadcrumbs } from '@tounsoo/todae/breadcrumbs';
import { Link } from '@tounsoo/todae/link';

export default function BreadcrumbsTrail() {
  return (
    <Breadcrumbs.Root>
      <Breadcrumbs.Item>
        <Link.Root href="#home">Home</Link.Root>
      </Breadcrumbs.Item>
      <Breadcrumbs.Item>
        <Link.Root href="#settings">Settings</Link.Root>
      </Breadcrumbs.Item>
      <Breadcrumbs.Item current>Billing</Breadcrumbs.Item>
    </Breadcrumbs.Root>
  );
}

Server Components can import it from @tounsoo/todae/breadcrumbs. That entry has no 'use client' and no hooks; the main @tounsoo/todae entry is a client module.

The landmark is named "Breadcrumb" unless you pass a non-empty aria-label or aria-labelledby. That default is the breadcrumbs string of StringsProvider, English unless you set it, and always English from the @tounsoo/todae/breadcrumbs server entry. A separator is drawn between items, / unless you pass separator or set a separator glyph (see Icons below), and screen readers skip it. The items wrap onto more lines when they do not fit.

import { Breadcrumbs } from '@tounsoo/todae/breadcrumbs';
import { Link } from '@tounsoo/todae/link';

export default function BreadcrumbsChevron() {
  return (
    <Breadcrumbs.Root separator="›" aria-label="이동 경로" lang="ko">
      <Breadcrumbs.Item>
        <Link.Root href="#home">홈</Link.Root>
      </Breadcrumbs.Item>
      <Breadcrumbs.Item current>설정</Breadcrumbs.Item>
    </Breadcrumbs.Root>
  );
}

Icons

With a separator glyph from a GlyphsProvider, each item draws that icon in place of the separator text. Draw it pointing toward the next item in a left-to-right page: it is mirrored in right-to-left. A separator on Breadcrumbs.Root wins over it, and the @tounsoo/todae/breadcrumbs server entry reads no provider.

import { ChevronRight } from 'lucide-react';

<GlyphsProvider glyphs={{ separator: <ChevronRight /> }}>
  <Breadcrumbs.Root>…</Breadcrumbs.Root>
</GlyphsProvider>

Accessible composition

Todae handles: A named nav landmark around an ol role="list", with each Breadcrumbs.Item as a list item. current wraps the item's text in a span with aria-current="page". The separator is CSS content with empty alternative text, or a glyph inside the item hidden with aria-hidden, so screen readers skip it and it adds no list items.

You supply: A link in every item but the last, with text that names the page it goes to. Plain text in the last item, marked current. On a page in another language, the translated name through StringsProvider, or aria-label when you import from the @tounsoo/todae/breadcrumbs server entry.

Watch for: Separators of your own, such as an icon or a / between items: they are read aloud, and outside an item they break the list. Pass separator, or set a separator glyph, instead. An element that wraps Breadcrumbs.Item, which puts something other than a list item inside the list. A current page marked by style alone, without current.

When to use

When: A page deep in a hierarchy, where people need to see where they are and move up.

When not: Steps in a flow the user moves through in order → a stepper. Sections of one page → Tabs. A site's or app's navigation → Nav.

Props

Breadcrumbs.Root props
NameTypeDescription
aria-labelstring

Landmark name. Default is the breadcrumbs string from StringsProvider; the server entry always uses English.

Default: "Breadcrumb"

aria-labelledbystring

Id of an element that names the landmark. When set, the default name is dropped.

separatorstring

Text drawn between items. Screen readers skip it.

Default: "/"

childrenReact.ReactNode

Breadcrumbs.Item elements, from the top page down to this one.

Breadcrumbs.Item props
NameTypeDescription
currentboolean

Wraps the text in a span with aria-current="page", marking the page you are on. Give it plain text, not a link.

Default: false

childrenReact.ReactNode

A link to the page, such as an a element or your router's link.