Skip to content
synccn

Breadcrumb

Path to the current page, with chevrons or slashes.

Installation

$ pnpm dlx shadcn@latest add @synccn/breadcrumb

First time in this project? Connect synccn with one command.

Usage

import { Breadcrumb } from "@/components/ui/breadcrumb";<Breadcrumb items={[{ label: "Home" }, { label: "Docs" }]} />

API reference

Generated from the component's TypeScript types, so it always matches the code.

Breadcrumb

items: [{ label, href?, icon? }] — the last item is the current page.

  • itemsrequired
    BreadcrumbItem[]

    Path from root to the current page (last item).

  • separator
    "chevron" | "slash"

    Default "chevron"

    Divider style.

  • renderLink
    (item: BreadcrumbItem, children: React.ReactNode) => React.ReactNode

    Render links with your router's Link component.

  • className
    string

    Extra classes for the root element.

Dependencies

Read from the component's imports when the site builds. The CLI installs all of these for you.

Helpers

npm packages

Accessibility

  • Wrapped in a nav labelled Breadcrumb; the last item is the current page.

From the source

Read from this component's code when the site builds, so it can't drift.

  • ARIA attributes: aria-current, aria-label