Pricing

Breadcrumb handbook

v1.2.0 · @snowui-design-system/components

License: Before reading component documentation, source, or npm usage instructions for the first time, read the full LICENSE. Reuse that review for the same task and version. Public API configuration and internal implementation changes have different license implications. All components use the unified runtime package; source rights remain governed by the license.

Overview

Show the current page’s hierarchy so users can see where they are and navigate to a parent page.

When to use it

Use Breadcrumb for the current page hierarchy. Use Tab to switch content at one level and Sidebar for application navigation. The page handles routing.

  • Items generate the path, and the last item automatically becomes the non-interactive current page.

  • Explicit children use Button as="item" and Text as="separator" to replace items; parts only configure the default generated content.

  • The default navigation name follows LocaleProvider; an explicit ariaLabel takes priority. Path labels and business content remain unchanged.

Quick start

This example shows the recommended basic composition. See the sections below for more cases and composition limits.

<script lang="ts">	import { Breadcrumb } from '@snowui-design-system/components';</script> <Breadcrumb	ariaLabel="SnowUI component page path"	items={[		{ label: 'Components' },		{ label: 'Navigation' },		{ label: 'Breadcrumb' }	]}/>

API

Keyword Type Default Description
ariaLabel string Locale message Accessible name for the root navigation. When omitted, follows LocaleProvider; an explicit ariaLabel takes priority.
gap number — Inherited Frame gap token index for preferred row and column spacing between path elements. Omit it to retain existing preferences. Effective spacing stays at least 4 CSS px, including zero and font/gap scaling. Larger preferences and ordinary root wrapping are preserved.
variant BreadcrumbVariant "borderless" Default variant for internally generated Button as="item" entries. An explicit child Button variant or parts override may take precedence.
children Snippet — Explicit Button as="item" and Text as="separator" children replace generated items and separators. The last item still becomes the current page.
items BreadcrumbItem[] [] Built-in path entries, each with label and optional href or disabled. Generates Buttons and separator Text. The last entry is the non-interactive current page. Ignored when children is supplied.
separator string "/" Separator text between built-in items. Used only in items mode; explicit composition declares as="separator" itself.
parts ComponentPartsOf<{ Button: typeof Button; Text: typeof Text }> — Configure generated Buttons and separator Text through parts. Explicit children do not inherit it. Breadcrumb still owns current-page and role semantics.

See the base component documentation for inherited capabilities not redeclared here. This table lists only named public Props declared by this component.

Usage boundaries and details

Feature overview

  • Default items API + explicit combination advanced API.

  • The last as="item" is automatically used as the current page.

  • The default Button variant can be provided to the internal Button as="item" through variant.

  • Non-current items are 40% opaque by default and return to 100% on hover.

  • Items share one navigation composition, so Button hover scaling is off by default. An item can explicitly set scaleOnHover={true}.

  • The current page item outputs aria-current="page", which cannot be hovered, clicked, or keyboard activated.

  • The separator uses 14px / 20px and black/10% by default.


Child roles

Role Recommended markup Description
item <Button as="item">...</Button> One item in the breadcrumb path.
separator <Text as="separator">/</Text> Separator. Declare it directly in explicit composition; default items mode also supports the separator prop.

SnowUI components use as="item" / as="separator"; native elements use data-as="item" / data-as="separator".

Basic usage

<Breadcrumb>    <Button as="item" href="/dashboards">Dashboards</Button>    <Text as="separator">/</Text>    <Button as="item">Default</Button></Breadcrumb>

Unified Button variant

<Breadcrumb variant="borderless">    <Button as="item" href="/dashboards">Dashboards</Button>    <Text as="separator">/</Text>    <Button as="item" variant="outline">Custom</Button>    <Text as="separator">/</Text>    <Button as="item">Default</Button></Breadcrumb>

Breadcrumb variant supplies the default for item Buttons without their own variant. An explicit Button variant takes precedence. If Breadcrumb has no variant, each Button uses its own default.

Multi-level path

<Breadcrumb>    <Button as="item" href="/">Home</Button>    <Text as="separator">/</Text>    <Button as="item" href="/dashboards">Dashboards</Button>    <Text as="separator">/</Text>    <Button as="item" href="/dashboards/default">Default</Button></Breadcrumb>

The last item becomes the current page automatically. Even when it has href, clicking it does not navigate.

Behavior rules

  1. The current page is fixed to the last as="item" / data-as="item" in Breadcrumb.

  2. currentIndex is not provided, and it is not supported to specify any item as the current page.

  3. The current item automatically sets aria-current="page", data-current="page", tabindex="-1".

  4. The current item does not respond to Button hover, click, Enter, or Space.

  5. Separator automatically sets aria-hidden="true".

  6. Breadcrumb's variant only affects the default Button variant of Button as="item" and does not override the sub-level explicit variant.

  7. Breadcrumb provides the default value of scaleOnHover=false for item; the explicit value of the sub-level Button takes precedence.

Layout model

Primary layout model: inline shell layout. See ../../../specs/maintainers/LayoutProtocol.md §12.4 (source reference: specs/maintainers/LayoutProtocol.md).

  • Breadcrumb renders a nav root whose content hugs its intrinsic width.

  • The root uses inline-flex and may wrap onto another line.

  • Child Buttons keep their own inline shell layout.

  • Child Text keeps its own text-flow layout.

  • Breadcrumb only manages the root gap, separator style, non-current transparency and the last current state.

  • Effective row and column spacing between path elements stays at least 4 CSS px, including explicit gap=0 and font/gap scaling; larger preferences are retained. The root still allows path fragments to wrap instead of forcing the entire navigation into singleLine. Button continues to own its internal single-line graphics/text layout.

Layout variable chain:

Variable Default Use
--snowui-breadcrumb-row-gap var(--gap-1) Gap between wrapped lines.
--snowui-breadcrumb-column-gap var(--gap-1) Gap between an item and its separator.
--snowui-breadcrumb-separator-font-size var(--text-14) Separator font size
--snowui-breadcrumb-separator-line-height var(--leading-14) Separator line height
--snowui-breadcrumb-separator-color var(--black-10, rgba(0,0,0,0.1)) Separator color
--snowui-breadcrumb-inactive-opacity 0.4 Non-current item default transparency
--snowui-breadcrumb-inactive-hover-opacity 1 Non-current item hover transparency

Read the full LICENSE first; reuse that review for the same task, version, and scope.

First use public component Props to match the desired appearance, preserving the existing look where possible. If changes are necessary, follow the style selection and override order: use your own class (including Tailwind already in the project) or an instance style. The names below are public overrides actually consumed by source; check their scope and do not modify private DOM. Choose the correct SnowUI token family. External apps need not install SnowUI website utilities.

Variable Purpose and default reference
--snowui-breadcrumb-column-gap-override Column spacing (default var(--gap-1) = 4px)
--snowui-breadcrumb-inactive-hover-opacity-override Non-current item hover transparency (default 1)
--snowui-breadcrumb-inactive-opacity-override Non-current item default transparency (default 0.4)
--snowui-breadcrumb-row-gap-override Line spacing (default var(--gap-1) = 4px)
--snowui-breadcrumb-separator-color-override Separator color (default var(--black-10))
--snowui-breadcrumb-separator-font-size-override Separator font-size (default var(--text-14) = 14px)
--snowui-breadcrumb-separator-line-height-override Separator line-height (default var(--leading-14) = 20px)

Design guide · Tokens · Composition boundaries

Required Props: no named required Props.

Bindable Props: this component declares no named two-way binding; handle state updates through public callbacks or its host.

Inherited declaration: Omit<FrameProps, "children">. See Frame’s public API; omitted fields are unavailable here.

Shared Frame API · Back to API

The following type declarations are actually referenced by public Props and come from source. A Svelte Snippet denotes a content fragment; ComponentProps denotes the Props of the corresponding component.

Source: components/src/context.ts

export type BreadcrumbVariant = "gray" | "filled" | "outline" | "borderless";

Source: components/src/components/Breadcrumb.svelte

export interface BreadcrumbItem {        label: string;        href?: string;        disabled?: boolean;    }

ComponentPartsOf

Source: components/src/logic/component-parts.svelte.ts

export type ComponentPartsOf<    T extends Record<string, Component<any>>,> = {    [K in keyof T]?: ConfigurableComponentPartProps<T[K]>;};

ConfigurableComponentPartProps

Source: components/src/logic/component-parts.svelte.ts

export type ConfigurableComponentPartProps<C extends Component<any>> = Partial<    Omit<ComponentProps<C>, ComponentPartControlledKey>>;

ComponentPartControlledKey

Source: components/src/logic/component-parts.svelte.ts

export type ComponentPartControlledKey =    | "children"    | "as"    | "value"    | "defaultValue"    | "open"    | "selected"    | "checked"    | "disabled"    | "readonly"    | "id"    | `on${string}`    | `aria-${string}`;