Skip Navigation

Breadcrumb

A component for detecting the path to the current page using links.

next pagenext page

Installation

Run the following command

pnpm dlx @shadext/cli add breadcrumb

API Reference

Props

proptypedefault value
variant
typeof buttonVariants
default
isActive
boolean
false
activeVariant
typeof buttonVariants
default
orientation
"horizontal"|
"vertical"
horizontal

Accessibility

the Breadcrumb component is accessible by default, and it follows the WAI-ARIA guidelines.

Keyboard Navigation

keydescription
Escape
closes BreadCrumb Popover/gets out of scope selected link
Enter
Opens/closes BreadCrumb Popover
ArrowDown/ArrowRight
Moves focus to the next link
ArrowUp/ArrowLeft
Moves focus to the previous link

Usage

import {
  Breadcrumb,
  BreadcrumbItem,
  BreadcrumbList,
  BreadcrumbPage,
  BreadcrumbSeparator,
} from "@/components/extension/breadcrumb";
import { Link } from "next/link";
<Breadcrumb>
  <BreadcrumbList>
    <BreadcrumbItem>
      <Link href="/">Home</Link>
    </BreadcrumbItem>
    <BreadcrumbSeparator />
    <BreadcrumbItem>
      <Link href="/components">Components</Link>
    </BreadcrumbItem>
    <BreadcrumbSeparator />
    <BreadcrumbItem>Breadcrumb</BreadcrumbItem>
  </BreadcrumbList>
</Breadcrumb>

Examples

Orientation

next page
next page
next pagenext page

By default, the Breadcrumb component uses the default variant for each item. You can change the variant by passing the variant prop to the BreadcrumbItem component.

next pagenext page

You can indicate the active item by passing the isActive prop to the BreadcrumbItem component.

Loading...

Active BreadCrumb

Loading...

This popover can be used to display the full path if it's too long to fit in the screen.

next page
Dashboard
next page
next page
Payments