Registry

Command Palette

Search for a command to run...

Login
registry:component

Breadcrumb

v1.0.0ga

Accessible breadcrumb primitive for route hierarchy navigation.

Registry Endpoint
Open JSON

npx shadcn@latest add @aavya/ui-breadcrumb

One-time setup — add the @aavya registry to your components.json so branded dependencies resolve to Aavya (not stock shadcn):

"registries": { "@aavya": "https://registry-dev.aavya.com/r/{name}.json" }

Or install by full URL: npx shadcn@latest add https://registry-dev.aavya.com/r/ui-breadcrumb.json

Live Preview
Props
PartPropTypeDefault
BreadcrumbLinkasChild?boolean

Breadcrumb forwards remaining props to all <nav> element props.

Guidelines

Do

  • Show the path to the current page, with the current page as non-interactive text (BreadcrumbPage).
  • Use the real page titles; keep labels short.
  • Collapse long trails with an ellipsis rather than wrapping.

Don’t

  • Don't make the current (last) item a link.
  • Don't use breadcrumbs as primary navigation — they're a secondary wayfinding aid.
  • Don't include every query-string step; show meaningful levels only.
Accessibility

Role

nav landmark with an ordered list; the current item uses aria-current="page" (handled).

Keyboard

Links are standard tab stops. (handled)

Screen reader

Announced as breadcrumb navigation; the current page is marked. Provide meaningful link text — you provide this.

Focus

Standard link focus. (handled)

Gotcha

The last crumb must be plain text (BreadcrumbPage), not a link — linking the current page confuses AT users.

Usage Snippet
import { Breadcrumb } from '@/components/ui/breadcrumb'

export default function Example() {
  return (
    <div className="p-6">
      <Breadcrumb />
    </div>
  )
}
Source Preview
import * as React from 'react'

import { Slot } from '@radix-ui/react-slot'
import { ChevronRight, MoreHorizontal } from 'lucide-react'

import { cn } from '@/lib/utils'

function Breadcrumb({ ...props }: React.ComponentProps<'nav'>) {
  return <nav aria-label='breadcrumb' data-slot='breadcrumb' {...props} />
}

function BreadcrumbList({ className, ...props }: React.ComponentProps<'ol'>) {
  return (
    <ol
      data-slot='breadcrumb-list'
      className={cn(
        'text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5',
        className
      )}
      {...props}
    />
  )
}

function BreadcrumbItem({ className, ...props }: React.ComponentProps<'li'>) {
  return <li data-slot='breadcrumb-item' className={cn('inline-flex items-center gap-1.5', className)} {...props} />
}

function BreadcrumbLink({
  asChild,
  className,
  ...props
}: React.ComponentProps<'a'> & {
  asChild?: boolean
}) {
  const Comp = asChild ? Slot : 'a'

  return (
    <Comp data-slot='breadcrumb-link' className={cn('hover:text-foreground transition-colors', className)} {...props} />
  )
}

function BreadcrumbPage({ className, ...props }: React.ComponentProps<'span'>) {
  return (
    <span
      data-slot='breadcrumb-page'
      role='link'
      aria-disabled='true'
      aria-current='page'
      className={cn('text-foreground font-normal', className)}
      {...p