Breadcrumbs

Where you are in the app. Ancestors link back up; the last crumb is the current page. Lives in the page header.

Default

<Breadcrumbs
	items={[
		{ label: 'Projects', href: '/projects', icon: 'folder' },
		{ label: 'Starefoss ledning', href: '/projects/42' },
		{ label: '5. mars' },
	]}
/>

Root icon

Rule: the first crumb always carries an icon for where the trail starts, and no other crumb does. The types enforce it: items is a Trail, whose first crumb needs an icon.

Long trails

Crumbs never wrap. The current page truncates first, then the trail scrolls sideways.

Switcher crumbs

Give a crumb a menu of its siblings and it opens a switcher, to jump to another project or vessel without going back up. The current one is ticked.

{
	label: project.name,
	menu: projects.map((p) => ({
		label: p.name,
		href: `/projects/${p.id}`,
		current: p.id === project.id,
	})),
}

Folded

With max, the middle of a deep trail folds into a menu behind the ellipsis. The first crumb and the last few stay.

<Breadcrumbs items={trail} max={3} />