Components

Breadcrumb

Animated React breadcrumbs for shadcn/ui and Tailwind CSS: the drop-in Breadcrumb adds growing hover underlines and an accessible current page — plus a Motion block that folds middle items into an animated “…” menu whenever the trail doesn't fit, without wrapping or layout shift.

  • Drop-in shadcn API
  • Responsive collapse
  • Radix Dropdown Menu
  • aria-current
  • Server Component friendly
100%

Installation

$ npx shadcn@latest add https://duskui.com/r/breadcrumb.json

Replaces components/ui/breadcrumb.tsx with the same parts and data-slot attributes. The base Breadcrumb is CSS only, so it renders in Server Components.

Usage

page-breadcrumb.tsx
import Link from "next/link"
import {
  Breadcrumb,
  BreadcrumbItem,
  BreadcrumbLink,
  BreadcrumbList,
  BreadcrumbPage,
  BreadcrumbSeparator,
} from "@/components/ui/breadcrumb"

export function PageBreadcrumb() {
  return (
    <Breadcrumb>
      <BreadcrumbList>
        <BreadcrumbItem>
          <BreadcrumbLink asChild>
            <Link href="/">Home</Link>
          </BreadcrumbLink>
        </BreadcrumbItem>
        <BreadcrumbSeparator />
        <BreadcrumbItem>
          <BreadcrumbPage>Settings</BreadcrumbPage>
        </BreadcrumbItem>
      </BreadcrumbList>
    </Breadcrumb>
  )
}

Examples

Default

Links brighten on hover; the current page is bright and marked with aria-current.

Icons, separator & ellipsis

Pass any separator as children of BreadcrumbSeparator, put icons inside links (they size themselves) and use BreadcrumbEllipsis for a static collapsed trail.

Blocks

Ready-made variations composed from the base component with Motion. Each installs on its own and pulls in its dependencies automatically.

Collapsible Breadcrumb

Give it the trail as items. It never wraps: when the trail is wider than its container, middle items slide out one by one into a “…” button, which opens an animated menu of the hidden pages. Widths are measured off-screen before paint, so there's no flash, and it re-fits on resize — drag the slider to try it.

100%
$ npx shadcn@latest add https://duskui.com/r/collapsible-breadcrumb.json
PropTypeDefaultDescription
items{ label: string; href?: string; icon?: ReactNode }[]—The trail, root first. The last item is the current page.
maxItemsnumber—Always collapse when there are more items than this.
itemsBeforeCollapsenumber1Items always shown before the “…”.
itemsAfterCollapsenumber1Items always shown after the “…” (including the current page).
separatorReactNode<ChevronRight />Custom separator.
linkAsElementType"a"Link component, e.g. Next.js Link.

Collapsible Breadcrumb — maxItems

maxItems collapses long trails even when they'd fit — here to three slots with a slanted slash separator.

$ npx shadcn@latest add https://duskui.com/r/collapsible-breadcrumb.json

API Reference

Same parts as shadcn/ui: Breadcrumb, BreadcrumbList, BreadcrumbItem, BreadcrumbLink, BreadcrumbPage, BreadcrumbSeparator and BreadcrumbEllipsis, each accepting its element's props.

PropTypeDefaultDescription
asChildbooleanfalseOn BreadcrumbLink: render your router's Link instead of an <a>.
childrenReactNode<ChevronRight />On BreadcrumbSeparator: a custom separator.

Accessibility

  • Breadcrumb renders a nav landmark labelled “breadcrumb” containing an ordered list, as the WAI-ARIA breadcrumb pattern recommends.
  • The current page carries aria-current="page" (without the misleading role="link" of the original).
  • Separators are presentational and hidden from screen readers.
  • The “…” trigger is named “Show 3 more pages” and opens a Radix menu with arrow-key navigation, typeahead and Escape; focus returns to the trigger on close.
  • The off-screen copy used for measuring is aria-hidden and inert, so links are never announced or focused twice.
  • Under prefers-reduced-motion items and the menu only fade.