Breadcrumb
The path from the top of the app to the current page, so people know where they are and can go up one or several levels.
import { Breadcrumb } from '@sypnia/ui/react'
Four levels
Each level is a link except the last.
Code
import { Breadcrumb } from '@sypnia/ui/react';
// The way up, from the organization to this page. The last item is where you are and is not a link.
export default function Basic() {
return (
<Breadcrumb items={[
{ label: 'Northwind', href: '#northwind' },
{ label: 'Storefront', href: '#storefront' },
{ label: 'Tables', href: '#tables' },
{ label: 'orders' },
]} />
);
} Inside an app
Press a level: the path shortens to it.
orders
Code
import { useState } from 'react';
import { Breadcrumb, Button, PageHeader } from '@sypnia/ui/react';
const path = ['Northwind', 'Storefront', 'Tables', 'orders'];
// With onClick instead of href, for apps that change the view without loading a page. Press a level to go up.
export default function InAnApp() {
const [depth, setDepth] = useState(path.length);
const here = path.slice(0, depth);
return (
<div className="sy-stack">
<Breadcrumb label="You are here" items={here.map((label, i) => (i === here.length - 1 ? { label } : { label, onClick: () => setDepth(i + 1) }))} />
<PageHeader title={here[here.length - 1]} actions={depth < path.length && <Button onClick={() => setDepth(path.length)}>Go back to orders</Button>} />
</div>
);
} Long names
Cut with an ellipsis; look at it on a phone.
Code
import { Breadcrumb } from '@sypnia/ui/react';
// Long names are cut with an ellipsis. On a phone only the parent and the page show.
export default function LongNames() {
return (
<Breadcrumb items={[
{ label: 'Northwind Traders International Holdings', href: '#org' },
{ label: 'Storefront for Latin America and the Caribbean', href: '#project' },
{ label: 'customer_shipping_addresses_archive_2025' },
]} />
);
} Skeleton
The real piece and its skeleton: the same box, so nothing moves when the data arrives.
Code
import { Breadcrumb, BreadcrumbSkeleton } from '@sypnia/ui/react';
// While the names of the organization and the project load.
export default function Skeleton() {
return (
<div className="sy-stack">
<Breadcrumb items={[{ label: 'Northwind', href: '#' }, { label: 'storefront', href: '#' }, { label: 'orders' }]} />
<BreadcrumbSkeleton items={3} />
</div>
);
} When to use it
Use it when
- The app has levels: organization, project, section, thing.
- At the top of the page, above the PageHeader.
Do not use it when
- The app is flat: there is nowhere to go up to.
- It would show the steps the person took: it shows where the page sits, not the history.
- It replaces the main navigation. It complements it.
For everyone
- It is a navigation region with a name (
label, «Breadcrumb» by default) containing an ordered list. - The last item is the page itself: it is not a link and is marked
aria-current="page". - The separators are decoration and are not read.
- On phones only the parent and the current page show, so it never scrolls sideways. Long names are cut with an ellipsis.
Props
| Breadcrumb | Type | Default |
|---|---|---|
itemsrequired | { label: ReactNode; href?: string | undefined; onClick?: (() => void) | undefined; }[] | |
label | string | Breadcrumb |