Breadcrumbs

A navigation trail indicator that shows the user's location in the documentation hierarchy.

The Breadcrumbs component displays a horizontal chain of breadcrumb links that indicates the navigation structure of the current active page.

Composable Breadcrumbs ExampleLink

Using the primitive Breadcrumbs subcomponents, you can design a custom breadcrumb indicator. The following example shows how to fetch the route segments via useBreadcrumbs and render them with custom icons and separators:

tsx
// docs/components/CustomBreadcrumbs.tsx
import React from 'react'
import { Breadcrumbs } from 'boltdocs/primitives'
import { useBreadcrumbs } from 'boltdocs/client'
import { Home } from 'lucide-react'

export default function CustomBreadcrumbs() {
  const { crumbs, activeRoute } = useBreadcrumbs()

  if (crumbs.length === 0) return null

  return (
    <Breadcrumbs.Root className="flex items-center gap-2 text-sm font-medium">
      
      {/* 1. Home Base Node */}
      <Breadcrumbs.Item>
        <Breadcrumbs.Link href="/" className="text-muted hover:text-body transition-colors flex items-center">
          <Home size={14} />
        </Breadcrumbs.Link>
      </Breadcrumbs.Item>

      {/* 2. Sibling Nodes */}
      {crumbs.map((crumb, idx) => {
        const isActive = crumb.href === activeRoute?.path

        return (
          <Breadcrumbs.Item key={`${crumb.href}-${idx}`} className="gap-2">
            <Breadcrumbs.Separator className="text-muted/40" />
            <Breadcrumbs.Link
              href={crumb.href}
              className={isActive
                ? 'text-body font-semibold cursor-default pointer-events-none'
                : 'text-muted hover:text-body transition-colors'
              }
            >
              {crumb.label}
            </Breadcrumbs.Link>
          </Breadcrumbs.Item>
        )
      })}
    </Breadcrumbs.Root>
  )
}

Composable SubcomponentsLink

The Breadcrumbs primitive provides the following subcomponents for structure customization:

ComponentHTML TagDescriptionProps
Breadcrumbs.Root / Breadcrumbs<nav>The main inline nav wrapper container.ComponentBaseProps
Breadcrumbs.Item<li>The individual breadcrumb cell container.ComponentBaseProps
Breadcrumbs.Link<a>An optimized anchor element linking to a parent route category.Breadcrumbs.Link Props
Breadcrumbs.Separator<span>Renders a directional separation icon (defaults to the Chevron Right icon).ComponentBaseProps

Component PropsLink

ComponentBaseProps (Common)Link

PropertyTypeDefaultDescription
childrenReactNodeundefinedChild content elements.
classNamestringundefinedCustom utility CSS classes.
styleCSSPropertiesundefinedInline style overrides.
PropertyTypeDefaultDescription
hrefstringRequiredTarget navigation route path.
classNamestringundefinedCSS class style override.

Inherits ComponentBaseProps plus:

PropertyTypeDefaultDescription
separatorReactNode(chevron right)Custom separator icon/component that replaces the default chevron.

Customization & statesLink

The Breadcrumbs primitive is style-neutral: it ships the <nav aria-label="Breadcrumb"> landmark with an <ol>/<li> hierarchy and the separator behavior, and every visual decision belongs to the theme through the className passthrough on Breadcrumbs (root), Breadcrumbs.Item, Breadcrumbs.Link, and Breadcrumbs.Separator. It paints no colors itself — current-item styling is driven by the data-current flag the final crumb receives.

State / SlotMechanism
Breadcrumbs (root)Renders <nav aria-label="Breadcrumb"> wrapping <ol>; layout and spacing via className
Breadcrumbs.Item<li> cell; the final (current) crumb also carries data-current
Current crumbRAC flags the last item: data-current on the <li> and aria-current="page" on the inner link
Breadcrumbs.Separator<span> chevron; color and size via className
Breadcrumbs.LinkPlain router <a>; hover and current colors via className
tsx
<Breadcrumbs className="flex items-center gap-2 text-sm text-muted">
  <Breadcrumbs.Item>
    <Breadcrumbs.Link href="/" className="hover:text-body transition-colors">
      Home
    </Breadcrumbs.Link>
  </Breadcrumbs.Item>
  <Breadcrumbs.Item className="data-current:text-body data-current:font-semibold">
    <Breadcrumbs.Separator className="text-muted/40" />
    <Breadcrumbs.Link href="/docs/guides" className="hover:text-body transition-colors">
      Guides
    </Breadcrumbs.Link>
  </Breadcrumbs.Item>
</Breadcrumbs>
Last updated on October 18, 2026

Was this page helpful?