Skip to content

Breadcrumb

Shows where the page sits in the site hierarchy — link trails for docs, store categories, and dashboards — in bold neobrutalist type.

import Link from "next/link"

import {

The breadcrumb shows the current page's position in the site hierarchy and links every level above it. It isn't a Base UI primitive — just semantic HTML (nav + <ol>) using Base UI's useRender for the render-prop composition — styled to the neobrutalist recipe: heading-font links, the current page in bold foreground type.

Reach for it when:

  • Docs and knowledge bases — Docs / Components / Breadcrumb; readers back out a level without hunting through the sidebar.
  • E-commerce category trees — Home / Clothing / Jackets escapes a deep product page in one click.
  • Dashboards and file browsers — nested projects, settings, or folder paths where the URL alone doesn't orient.

Installation

pnpm dlx shadcn@latest add https://neobrutalism.com/r/base/breadcrumb.json
npx shadcn@latest add https://neobrutalism.com/r/base/breadcrumb.json
yarn dlx shadcn@latest add https://neobrutalism.com/r/base/breadcrumb.json
bunx --bun shadcn@latest add https://neobrutalism.com/r/base/breadcrumb.json

Copy and paste the following code into your project.

components/ui/breadcrumb.tsx
import * as React from "react"
import { ChevronRightIcon, MoreHorizontalIcon } from "lucide-react"
import { Slot } from "radix-ui"

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

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

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

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

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

  return (
    <Comp
      data-slot="breadcrumb-link"
      className={cn("font-head transition-colors hover:text-foreground", 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("font-medium text-foreground", className)}
      {...props}
    />
  )
}

function BreadcrumbSeparator({
  children,
  className,
  ...props
}: React.ComponentProps<"li">) {
  return (
    <li
      data-slot="breadcrumb-separator"
      role="presentation"
      aria-hidden="true"
      className={cn("[&>svg]:size-3.5", className)}
      {...props}
    >
      {children ?? <ChevronRightIcon className="cn-rtl-flip" />}
    </li>
  )
}

function BreadcrumbEllipsis({
  className,
  ...props
}: React.ComponentProps<"span">) {
  return (
    <span
      data-slot="breadcrumb-ellipsis"
      role="presentation"
      aria-hidden="true"
      className={cn(
        "flex size-5 items-center justify-center [&>svg]:size-4",
        className
      )}
      {...props}
    >
      <MoreHorizontalIcon />
      <span className="sr-only">More</span>
    </span>
  )
}

export {
  Breadcrumb,
  BreadcrumbList,
  BreadcrumbItem,
  BreadcrumbLink,
  BreadcrumbPage,
  BreadcrumbSeparator,
  BreadcrumbEllipsis,
}

Update the import paths to match your project setup.

Usage

import {
  Breadcrumb,
  BreadcrumbItem,
  BreadcrumbLink,
  BreadcrumbList,
  BreadcrumbPage,
  BreadcrumbSeparator,
} from "@/components/ui/breadcrumb"
<Breadcrumb>
  <BreadcrumbList>
    <BreadcrumbItem>
      <BreadcrumbLink render={<a href="/" />}>Home</BreadcrumbLink>
    </BreadcrumbItem>
    <BreadcrumbSeparator />
    <BreadcrumbItem>
      <BreadcrumbLink render={<a href="/components" />}>
        Components
      </BreadcrumbLink>
    </BreadcrumbItem>
    <BreadcrumbSeparator />
    <BreadcrumbItem>
      <BreadcrumbPage>Breadcrumb</BreadcrumbPage>
    </BreadcrumbItem>
  </BreadcrumbList>
</Breadcrumb>

Composition

Use the following composition to build a Breadcrumb:

Breadcrumb
└── BreadcrumbList
    ├── BreadcrumbItem
    │   └── BreadcrumbLink
    ├── BreadcrumbSeparator
    ├── BreadcrumbItem
    │   └── BreadcrumbLink
    ├── BreadcrumbSeparator
    └── BreadcrumbItem
        └── BreadcrumbPage

Examples

Basic

A basic breadcrumb with a home link and a components link.

import {
  Breadcrumb,
  BreadcrumbItem,

Custom separator

Use a custom component as children for <BreadcrumbSeparator /> to create a custom separator.

import Link from "next/link"
import { DotIcon } from "lucide-react"

You can compose <BreadcrumbItem /> with a <DropdownMenu /> to create a dropdown in the breadcrumb.

import Link from "next/link"
import { ChevronDownIcon, DotIcon } from "lucide-react"

Collapsed

We provide a <BreadcrumbEllipsis /> component to show a collapsed state when the breadcrumb is too long.

import Link from "next/link"

import {

To use a custom link component from your routing library, you can use the render prop on <BreadcrumbLink />.

import Link from "next/link"

import {

RTL

To enable RTL support in Neobrutalism.com, see the RTL configuration guide.

"use client"

import Link from "next/link"

Accessibility

The breadcrumb follows the WAI-ARIA Breadcrumb pattern: Breadcrumb renders a <nav aria-label="breadcrumb"> landmark wrapping an ordered list, so screen readers announce it as breadcrumb navigation and users can jump straight to it. BreadcrumbPage carries aria-current="page" to mark the current location, and separators are aria-hidden so they aren't read aloud. Items are plain links — standard Tab and Enter behavior, no extra keyboard wiring needed.

API Reference

The Breadcrumb component is the root navigation element that wraps all breadcrumb components.

PropTypeDefault
classNamestring-

The BreadcrumbList component displays the ordered list of breadcrumb items.

PropTypeDefault
classNamestring-

The BreadcrumbItem component wraps individual breadcrumb items.

PropTypeDefault
classNamestring-

The BreadcrumbLink component displays a clickable link in the breadcrumb.

PropTypeDefault
classNamestring-

The BreadcrumbPage component displays the current page in the breadcrumb (non-clickable).

PropTypeDefault
classNamestring-

The BreadcrumbSeparator component displays a separator between breadcrumb items. You can pass custom children to override the default separator icon.

PropTypeDefault
childrenReact.ReactNode-
classNamestring-

The BreadcrumbEllipsis component displays an ellipsis indicator for collapsed breadcrumb items.

PropTypeDefault
classNamestring-