Skip to main content
PROYECTOVIVIANA

Breadcrumbs

Breadcrumbs show a navigational hierarchy of pages, helping users understand where they are within a site and navigate back to parent sections.

Import

import { Breadcrumbs, BreadcrumbItem } from '@proyecto-viviana/solid-spectrum';

Basic Breadcrumbs

A simple breadcrumb trail showing page hierarchy. The last item is the current page and is not a link.

<Breadcrumbs items={basicCrumbs}>
  {(crumb) => (
    <BreadcrumbItem id={crumb.id} href={crumb.href}>
      {crumb.label}
    </BreadcrumbItem>
  )}
</Breadcrumbs>

Interactive Navigation

Click any breadcrumb to navigate back to that level. The trail updates to reflect the new location.

  1. Home
  2. Products
  3. Electronics
  4. Laptops

Current page: Laptops

<Breadcrumbs items={crumbs()} onAction={handleNavigate}>
  {(crumb) => (
    <BreadcrumbItem id={crumb.id} href={crumb.href}>
      {crumb.label}
    </BreadcrumbItem>
  )}
</Breadcrumbs>

Size Variants

Breadcrumbs support different sizes to match surrounding content.

Small

  1. Dashboard
  2. Settings
  3. Profile

Medium (default)

  1. Dashboard
  2. Settings
  3. Profile

Large

  1. Dashboard
  2. Settings
  3. Profile
<Breadcrumbs size="sm" items={dashboardCrumbs}>
  {(crumb) => (
    <BreadcrumbItem id={crumb.id} href={crumb.href}>
      {crumb.label}
    </BreadcrumbItem>
  )}
</Breadcrumbs>

File Path Breadcrumbs

Breadcrumbs work well for displaying file or folder navigation paths.

  1. Root
  2. ui
  3. Button.tsx
<Breadcrumbs items={deepCrumbs}>
  {(crumb) => (
    <BreadcrumbItem id={crumb.id} href={crumb.href}>
      {crumb.label}
    </BreadcrumbItem>
  )}
</Breadcrumbs>

Breadcrumbs Props

Props

PropTypeDefaultDescription
itemsT[]Data items to render as breadcrumb entries
children(item: T) => JSX.ElementRender function called for each item to produce BreadcrumbItem elements
size'sm' | 'md' | 'lg''md'Size variant affecting font size and spacing
isDisabledbooleanfalseWhether all breadcrumb links are disabled
onAction(key: Key) => voidHandler called when a breadcrumb item is pressed

BreadcrumbItem Props

Props

PropTypeDefaultDescription
idstringUnique identifier for the breadcrumb item
hrefstringURL for the breadcrumb link. Omit for the current page.
childrenJSX.ElementLabel content of the breadcrumb
isDisabledbooleanfalseWhether this breadcrumb link is disabled

Accessibility

  • Uses nav element with aria-label="Breadcrumbs"
  • Items use an ol list structure for proper semantics
  • Current page is marked with aria-current="page"
  • Separator characters are hidden from screen readers
  • Links are focusable and activatable via keyboard
  • Screen readers announce the full trail context