Skip to content

Breadcrumb

The path to the current page, with the middle folded into a menu when it gets long.

On this page
Used for
  • Project path
  • Run in a pipeline
  • Doc location
  • Folder trail

Examples

Installation

npx knowns-ui@latest add breadcrumb
For Claude Code, Cursor or Codex: installs it and wires the props to your own data.

Props

items
{ label, href?, icon?, onClick? }[]
Root first; the last item is the current page (aria-current).
maxItems
number
Default4
Longer trails fold the middle into a … Menu.
keepStart / keepEnd
number
Default1 / 2
Items kept before and after the fold.
separator
"chevron" | "slash"
Default"chevron"
Drawn between items, hidden from screen readers.
size
"sm" | "md"
Default"md"
12.5 or 13.5px text.

What it handles

  1. 01Renders a nav with an ordered list of crumbs, root first, where the last item is the current page with aria-current page.
  2. 02Makes a crumb a link when it has href, a button when it only has onClick, and runs onClick on a link too for client-side routing.
  3. 03Folds the middle of a trail longer than maxItems into a menu button, keeping keepStart items first and keepEnd last (1 and 2 by default).
  4. 04Lists the folded crumbs in a Menu labelled with how many are hidden, and runs each crumb's onClick when chosen.
  5. 05Truncates a long label at 16rem and lets the row wrap instead of scrolling sideways.
  6. 06Separates crumbs with a chevron or a slash, shows an optional icon before a label, and comes in sm and md.

States

First render
Nothing. The trail paints as it is
none
Crumb hover
The text colour moves to the foreground
120ms, ease out
Overflow button hover
The three dots get a muted background
120ms, ease out
Overflow menu opens
The folded crumbs open in the Menu panel
none
Trail changes
It updates at once
none

Works with

When to use

When to use

  • Showing where a page sits in a hierarchy, with long trails folding into a menu.

When not to use

  • A full page header with title, status and actions: use Page Header.

Using with AI

Use Copy page for AI above to give your assistant this page, Copy prompt under the install command to have it installed and wired to your data, or connect the Knowns UI MCP server and just ask:

  • Add the Knowns UI Breadcrumb to my app and wire it to my own data.
  • I need showing where a page sits in a hierarchy, with long trails folding into a menu. Set that up with the Knowns UI Breadcrumb.
  • Which Breadcrumb props do I need for a minimal setup? Show me a short example.

With the server connected, your assistant calls get_component({ name: "breadcrumb" }) and search_docs({ query: "breadcrumb" }).

Need help?

Stuck on Breadcrumb, or found something off? We read every message.