Breadcrumbs
Shows where the current page sits in the hierarchy, with links back to each level.
Preview
Installation
pnpm add @syntara/react @syntara/tokensimport { Breadcrumbs, Breadcrumb } from '@syntara/react';Usage
import { Breadcrumb, Breadcrumbs } from '@syntara/react';
export function ClaimTrail() {
return (
<Breadcrumbs>
<Breadcrumb href="/">Home</Breadcrumb>
<Breadcrumb href="/claims">Claims</Breadcrumb>
<Breadcrumb>CLM-20481</Breadcrumb>
</Breadcrumbs>
);
}Examples
Collapsed
maxItems folds the middle of a long trail into an ellipsis button that expands it.
With an icon
Icons in children are sized to the text.
Accessibility
| Keys | Action |
|---|---|
| Tab | Moves between links; the current page is not a tab stop. |
| Enter | Follows the focused link, or expands a collapsed trail from the ellipsis button (focus moves to the first revealed link). |
- Renders <nav aria-label="Breadcrumbs"> around an <ol> with the same name. Landmark names must be unique: pass aria-label when a page shows more than one trail.
- The last item has aria-current="page" and is not a link; it is set in medium weight so it doesn't rely on colour.
- Chevron separators are decorative (aria-hidden) and mirror in right-to-left layouts.
Guidelines
Do
- Start at the top level of the product and end at the current page.
- Use the page titles people see in headings.
- Collapse trails deeper than about four levels with maxItems.
Don’t
- Don't use breadcrumbs for steps in a flow — use Steps.
- Don't make the current page a link.
- Don't use them as the only navigation on a page.
API reference
Breadcrumbs
childrenRequiredReactNodeBreadcrumb elements, root first. The last one is the current page.
maxItemsnumberCollapse when there are more items: keeps the first and the last maxItems − 1, with an ellipsis button between.
aria-labelstringName of the navigation landmark and the list. Must be unique on a page — name each trail if a page has more than one.
Default
'Breadcrumbs'expandLabelstringAccessible name of the ellipsis button.
Default
'Show all breadcrumbs'isDisabledbooleanDisables every link.
Default
falseonAction(key: Key) => voidCalled when an item is pressed (for client-side routing without hrefs).
Breadcrumb
hrefstringLink target. Ignored on the last (current) item.
idKeyKey passed to onAction.
linkPropsOmit<LinkProps, 'href' | 'children' | 'className'>Extra props for the inner link, e.g. target or routerOptions.
autoFocusbooleanFocuses the link when it mounts.
Default
false
Tokens
The semantic tokens this component reads, grouped by what they control. Swatches show this site’s theme; change a tenant’s brand and the component follows with no code change.
- Colour4
text.subtletext.defaultfocus.ringtext.disabled- Type3
font.size.smline-height.snugfont.weight.medium- Space and size3
space.1space.6space.2- Shape1
radius.badge- Motion6
motion.duration.fastmotion.easingmotion.duration.normalmotion.easing-outmotion.duration.springmotion.spring