Build faster with Premium Chakra UI Components 💎

Learn more
Skip to Content
DocsPlaygroundGuidesBlog
Sponsor

Breadcrumb

Used to display a page's location within a site's hierarchical structure

SourceStorybookRecipe

Setup

If you don't already have the snippet, run the following command to add the breadcrumb snippet

npx @chakra-ui/cli snippet add breadcrumb

The snippet includes a closed component composition for the Breadcrumb component.

Usage

import {
  BreadcrumbCurrentLink,
  BreadcrumbLink,
  BreadcrumbRoot,
} from "@/components/ui/breadcrumb"
<BreadcrumbRoot>
  <BreadcrumbLink href="#">Docs</BreadcrumbLink>
  <BreadcrumbLink href="#">Components</BreadcrumbLink>
  <BreadcrumbCurrentLink>Props</BreadcrumbCurrentLink>
</BreadcrumbRoot>

Examples

Sizes

Use the size prop to change the size of the breadcrumb component

Variants

Use the variant prop to change the appearance of the breadcrumb component

With Separator

Use the separator prop to add the separator

Icon

Here's how you can add an icon to the breadcrumb

Compose the breadcrumb with menu component

Ellipsis

Render the BreadcrumbEllipsis component to show an ellipsis

Routing Library

Use the asChild prop to change the underlying breadcrumb link

import { Link } from "next/link"

export const Example = () => {
  return (
    <BreadcrumbRoot>
      <BreadcrumbLink asChild>
        <Link href="/docs">Docs</Link>
      </BreadcrumbLink>
    </BreadcrumbRoot>
  )
}

Without Snippet

If you don't want to use the snippet, you can use the Breadcrumb component from the @chakra-ui/react package.

Props

Root

PropDefaultType
colorPalette 'gray'
'gray' | 'red' | 'orange' | 'yellow' | 'green' | 'teal' | 'blue' | 'cyan' | 'purple' | 'pink' | 'accent'

The color palette of the component

variant 'plain'
'underline' | 'plain'

The variant of the component

size 'md'
'sm' | 'md' | 'lg'

The size of the component

separator
React.ReactNode

separatorGap
SystemStyleObject['gap']

as
React.ElementType

The underlying element to render.

asChild
boolean

Use the provided child element as the default rendered element, combining their props and behavior.

For more details, read our Composition guide.
unstyled
boolean

Whether to remove the component's style.

Previous

Badge

Next

Button