Skip to content
Navigation Core Stable

Breadcrumb

.md

A data-driven trail of links with automatic truncation, a decorative separator, and the current page marked for assistive tech.

Available for Svelte 5, React, and Vue 3.

Preview

Installation

pnpm add fancy-ui-svelte
import { Breadcrumb } from "fancy-ui-svelte";

Usage

svelte
<script lang="ts">
	import { Breadcrumb } from "fancy-ui-svelte";
	import type { BreadcrumbItem } from "fancy-ui-svelte";

	const items: BreadcrumbItem[] = [
		{ label: "Docs", href: "/docs" },
		{ label: "Core", href: "/docs/core" },
		{ label: "Button" },
	];
</script>

<Breadcrumb sound {items} />

Examples

Basic Usage

A three-level trail; the last item is the current page.

Truncated

A five-level trail collapsed to first, ellipsis, and last two.

Custom Separator

A '>' glyph in place of the default slash.

Props

PropTypeDefaultDescription
items *BreadcrumbItem[]-The full trail, first to last. The last entry is always the current page.
maxItems number0Collapse the trail once it holds more than this many items. 0 never collapses.
itemsBeforeCollapse number1How many leading items stay visible once collapsed.
itemsAfterCollapse number1How many trailing items stay visible once collapsed. Floored at 1 — the current page is never hidden.
separator string"/"Separator glyph rendered between crumbs. Decorative — never read by a screen reader.
label string"Breadcrumb"Accessible name for the nav.
class string-Additional CSS classes, merged onto the nav.
ref HTMLElement | nullnullBindable reference to the nav element.
sound booleanfalsePlays select when a default-rendered crumb link is activated, once the user has enabled sound

Slots

SlotDescription
item Custom rendering for one crumb, given the item and its index in items (Snippet<[BreadcrumbItem, number]>). Optional — fully replaces the default link/current-page rendering, including aria-current, once supplied.