Skip to content

shadcn.io is an independent project built on shadcn/ui

Free

Breadcrumb with Dropdown (Standard) for React

A breadcrumb with Home, a folder menu of Documentation, Themes, and GitHub, then Components and Breadcrumb.

The trail reads Home, then a folder button, then Components, then Breadcrumb as the current page. The folder opens Documentation, Themes, and GitHub. The button is named Show sections.

Use it when the collapsed levels must stay reachable. An ellipsis is enough if they can be dropped. Sibling pages that are one value fit a Select. In React, Base UI does not fill the menu from the route.

Preview

Preview width

Installation

Sign in to get your install command
Free with an account. It carries your token, so the CLI installs everything in one go.
Use email insteadNo credit card

Anatomy

Breadcrumb anatomy: link, ellipsis, separator, item, page

Usage

<Breadcrumb>
  <BreadcrumbList>
    <BreadcrumbItem>
      <BreadcrumbLink render={<Link href="/" />}>Home</BreadcrumbLink>
    </BreadcrumbItem>
    <BreadcrumbSeparator />
    <BreadcrumbItem>
      <DropdownMenu>
        <DropdownMenuTrigger
          aria-label="Show sections"
          render={
            <button className="flex items-center gap-1" type="button" />
          }
        >
          <FolderIcon aria-hidden="true" className="size-4" />
        </DropdownMenuTrigger>
        <DropdownMenuContent align="start">
          <DropdownMenuGroup>
            <DropdownMenuItem>Documentation</DropdownMenuItem>
            <DropdownMenuItem>Themes</DropdownMenuItem>
            <DropdownMenuItem>GitHub</DropdownMenuItem>
          </DropdownMenuGroup>
        </DropdownMenuContent>
      </DropdownMenu>
    </BreadcrumbItem>
    <BreadcrumbSeparator />
    <BreadcrumbItem>
      <BreadcrumbLink render={<Link href="/components" />}>
        Components
      </BreadcrumbLink>
    </BreadcrumbItem>
{/* The rest of the file is under Installation. */}

FAQ

How is the menu built?

DropdownMenu wraps a DropdownMenuTrigger and a DropdownMenuContent with align="start" and three DropdownMenuItems.

How is the folder button named?

Its only child is a FolderIcon, hidden from assistive tech, so the button carries aria-label="Show sections". Without it the button would have no name.

Do the menu items navigate?

Not in the demo: they are plain items. Make each one a link to its section, or handle the selection and route from there.

How is the trail announced?

Breadcrumb renders a nav labeled breadcrumb around an ordered list, so screen readers announce a breadcrumb landmark and the number of items. Home and Components are read as links.

Which separator sits between the crumbs?

An empty BreadcrumbSeparator renders a chevron, hidden from assistive tech.

How do the links go through my router?

BreadcrumbLink takes the link through render, as in render={<Link href="/" />} with the Next.js Link.

API Reference

Breadcrumb

No extra props in this demo. The rest is on the Breadcrumb page.

Dropdown Menu

Sets align="start". The rest is on the Dropdown Menu page.