Breadcrumb
A React component in Beamline's Navigation category, in the free sample.
Where a page sits and the way back up; it shows as many levels as its room holds and folds the ones nearest the top into a menu.
Use it for
- Showing where a page sits in a hierarchy and jumping back up.
Not for
- Flat apps with one level (use the page title).
- Steps in a flow (stepper).
Anatomy
- nav landmark
- levels: link (icon + label) and the separator after it (chevron, flipped in RTL)
- fold menu (⋯) with the levels that have no room
- current page (text)
States
- whole path (every level has room, each at its natural width)
- folded by room: the levels nearest the top go behind ⋯ first, the parent of this page stays longest; the first level and the current page always show (useFit)
- capped by maxItems: the first level and the last maxItems − 1 at most
- short of room even folded: ancestors give way to a few letters and an ellipsis, and a clipped name is said in full in the system tooltip when pointed at or focused (a whole one says nothing more); the current page keeps the most
Keyboard
- Tab through the links and the fold menu
- Touch: each level's link has a 44 px tall target (drawn outside the row, no layout change); hover ink only where a pointer hovers, so a tapped level does not keep it
Motion
A fold keeps everyone's path (useFlip): as the room narrows a level leaves into ⋯ and its neighbours slide together; as it widens the level grows back in where it was. Going deeper adds a crumb that grows in; going up lets the dropped crumbs fade where they stood. A link press is acknowledged at once (press scale). Reduced motion places at once.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
items | { label, href?, onClick?, icon? }[] | — | From the top level to the current page; the last item is the page itself. |
maxItems | number | as many as the room holds | Show at most this many levels even when the room has space for more (the first and the current always show). Default: as many as the room holds. |
label | string | "Breadcrumb" | The landmark's name. Default "Breadcrumb". |
classNames | BreadcrumbClassNames; menuClassNames:MenuClassNames | — | Classes for the named visual parts; no part overrides by default. |
style / ref | CSSProperties / native Ref | — | style: Inline styles on the documented visual root; no inline overrides by default. ref: Receives the documented root element; no ref by default. |
className | string | — | Classes on the documented visual root; no override by default. |
menuClassNames | MenuClassNames | — | Classes for the menu component's named parts; no overrides by default. |
style | CSSProperties | — | Inline styles on the documented visual root; no inline overrides by default. |
ref | Ref<HTMLElement> | — | Receives the documented root element; no ref by default. |
Built from
Used in
Dependencies
lucide-react
Import
import { Breadcrumb } from "@beamline/breadcrumb";
Get it
Breadcrumb is part of Beamline UI. Install the parts you need in your React app as compiled packages or editable source. Breadcrumb is included in the free MIT sample. Get Beamline · Connect your agent
More in Navigation
- Sidebar: The app's main navigation: sections, items with counts and one level of sub-pages, an icon rail with tooltips (⌘B, the trigger or the edge), and a sheet…
- Tree view: Nested folders and records with the full tree keyboard model (arrows, Home/End, *, type to jump), depth guides, counts and animated opening.
- Stepper: Where someone is in a multi-step flow: done steps carry a check, the current one a ring, and the line between marks fills as steps complete.
- Table of contents: The sections of a long page beside it, with the one being read marked as you scroll: the marker travels down the rail between sections, the rail fills…
- Tabs: Switches between panels of one object; one indicator slides to the active tab, counts sit beside labels, and the tabs a row has no room for fold into More.
- Navigation menu: A site or docs header whose sections open into one panel that resizes and slides between them; NavigationMenuCard is the standard link row.
- Menu bar: A desktop-style File / Edit / View bar for editor-like apps; each menu takes the same rows as the dropdown menu, and pointing moves between open menus.
- Pagination: Moves through pages of a known length: first, last and the current page's neighbours, with an optional “41–60 of 468”. It answers to its own room…
- User menu: The account menu behind the avatar: who is signed in, status, theme, account pages and sign out with progress; a bottom sheet on phones.