Navigation Core Stable

Breadcrumb

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

Preview

Installation

pnpm add fancy-ui-svelte
import { Breadcrumb } from 'fancy-ui-svelte'

Usage

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

<Breadcrumb />

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.

Slots

SlotDescription
itemCustom 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.