--- title: Breadcrumb description: "`Breadcrumb` is a component that helps users understand the hierarchy of a website." links: - style: https://github.com/yamada-ui/yamada-ui/tree/main/packages/react/src/components/breadcrumb/breadcrumb.style.ts - source: https://github.com/yamada-ui/yamada-ui/tree/main/packages/react/src/components/breadcrumb - storybook: https://yamada-ui.github.io/yamada-ui?path=/story/components-breadcrumb--basic --- # Breadcrumb `Breadcrumb` is a component that helps users understand the hierarchy of a website. ```tsx サイヤ人編 ナメック星編 人造人間編 魔人ブウ編 ``` ## Usage ```tsx import { Breadcrumb } from "@yamada-ui/react" ``` ```tsx import { Breadcrumb } from "@/components/ui" ``` ```tsx import { Breadcrumb } from "@workspaces/ui" ``` ```tsx ``` :::tip If your framework provides a link component, set `as={FrameworkLink}` on `Breadcrumb.Link`. For integration details, see the [documentation for each framework](https://yamada-ui.com/docs/get-started.md#pick-your-framework). ::: :::tip To display progress across multiple steps, use [Steps](https://yamada-ui.com/docs/components/steps.md). ::: ### Use items ```tsx const items = useMemo( () => [ { href: "/", label: "サイヤ人編", }, { href: "/", label: "ナメック星編", }, { href: "/", label: "人造人間編", }, { href: "/", currentPage: true, label: "魔人ブウ編", }, ], [], ) return ``` ### Change variant ```tsx {(variant, index) => ( サイヤ人編 ナメック星編 人造人間編 魔人ブウ編 )} ``` ### Customize the Separator To customize the separator, set a separator character to `separator`. ```tsx サイヤ人編 ナメック星編 人造人間編 魔人ブウ編 ``` To use an icon as a separator, set a `ReactNode` to `separator`. ```tsx }> サイヤ人編 ナメック星編 人造人間編 魔人ブウ編 ``` ### Use Ellipsis To use ellipsis, set `Breadcrumb.Ellipsis` at the position where you want to use ellipsis. ```tsx 孫悟空少年編 人造人間編 魔人ブウ編 ``` Alternatively, you can use ellipsis by setting numerical values to `startBoundaries` and `endBoundaries`. ```tsx const items = useMemo( () => [ { href: "/", label: "サイヤ人編", }, { href: "/", label: "ナメック星編", }, { href: "/", label: "人造人間編", }, { href: "/", currentPage: true, label: "魔人ブウ編", }, ], [], ) return ``` ### Display Ellipsis Items in a Menu ```tsx 孫悟空少年編 ピッコロ大魔王編 サイヤ人編 フリーザ編 人造人間編 魔人ブウ編 ``` ### Customize the Ellipsis ```tsx const items = useMemo( () => [ { href: "/", label: "サイヤ人編", }, { href: "/", label: "ナメック星編", }, { href: "/", label: "人造人間編", }, { href: "/", currentPage: true, label: "魔人ブウ編", }, ], [], ) return ( { return ( {items.map(({ href, label }, index) => ( {label} ))} ) }} endBoundaries={1} items={items} startBoundaries={1} /> ) ``` ## Props ### Breadcrumb.Root | Prop | Default | Type | Description | | ----------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------ | | `as` | - | `As` | The HTML element to render. | | `asChild` | - | `boolean` | Merges its props onto its immediate child. | | `css` | - | `CSSObject \| CSSObject[]` | The CSS object. | | `colorScheme` | - | `"amber" \| "black" \| "blackAlpha" \| "blue" \| "cyan" \| "danger" \| "emerald" \| "error" \| "flashy" \| "fuchsia" ...` | Set color scheme variables. | | `size` | `"md"` | `"lg" \| "md" \| "sm"` | The size of the component. | | `variant` | `"plain"` | `"plain" \| "underline"` | The variant of the component. | | `ellipsis` | - | `string \| number \| bigint \| boolean \| ReactElement> \| Iterable \| ReactPortal \| Promise<...> \| ((props: { ...; }) => ReactNode)` | The icon to be used in the ellipsis. | | `endBoundaries` | `0` | `number` | Number of elements visible on the end(right) edges. | | `itemProps` | - | `BreadcrumbItemProps` | Props for item element. | | `items` | - | `BreadcrumbItem[]` | If provided, generate breadcrumb items based on items. | | `link` | - | `ReactElement>` | The component to be used for the link. | | `listProps` | - | `HTMLStyledProps<"ol">` | Props for ol element. | | `separator` | `"/"` | `ReactElement \| string` | The visual separator between each breadcrumb item. | | `separatorProps` | - | `BreadcrumbSeparatorProps` | Props for separator element. | | `startBoundaries` | `0` | `number` | Number of elements visible on the start(left) edges. | ### Breadcrumb.Ellipsis | Prop | Default | Type | Description | | ------------- | ------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------ | | `as` | - | `As` | The HTML element to render. | | `asChild` | - | `boolean` | Merges its props onto its immediate child. | | `css` | - | `CSSObject \| CSSObject[]` | The CSS object. | | `colorScheme` | - | `"amber" \| "black" \| "blackAlpha" \| "blue" \| "cyan" \| "danger" \| "emerald" \| "error" \| "flashy" \| "fuchsia" ...` | Set color scheme variables. | ### Breadcrumb.Link | Prop | Default | Type | Description | | ------------- | ------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------ | | `as` | - | `As` | The HTML element to render. | | `asChild` | - | `boolean` | Merges its props onto its immediate child. | | `css` | - | `CSSObject \| CSSObject[]` | The CSS object. | | `colorScheme` | - | `"amber" \| "black" \| "blackAlpha" \| "blue" \| "cyan" \| "danger" \| "emerald" \| "error" \| "flashy" \| "fuchsia" ...` | Set color scheme variables. | | `currentPage` | `false` | `boolean` | If `true`, change to span element. | ## Accessibility `Breadcrumb` follows the [WAI-ARIA - Breadcrumb Pattern](https://www.w3.org/WAI/ARIA/apg/patterns/breadcrumb/) for accessibility. When using `Breadcrumb`, set the `aria-label` for `Breadcrumb.Root`. ```tsx サイヤ人編 ナメック星編 人造人間編 魔人ブウ編 ``` ### ARIA Roles and Attributes | Element | Roles and Attributes | Usage | | ----------------------------- | --------------------- | ------------------------------------------------------------------ | | `nav.ui-breadcrumb__root` | `aria-label` | If `aria-label` is not set, `"Breadcrumb"` will be set by default. | | `span.ui-breadcrumb__link` | `aria-current="page"` | Sets when `currentPage` is `true`. | | `svg.ui-breadcrumb__ellipsis` | `role="presentation"` | Indicates that this is a presentation. | | | `aria-label` | Sets `"Ellipsis"`. | ## Similar Components - [Steps](https://yamada-ui.com/docs/components/steps.md): `Steps` is a component that displays the progress of a multi-step process. - [Tabs](https://yamada-ui.com/docs/components/tabs.md): `Tabs` is a component for switching between different display areas. - [Sidebar](https://yamada-ui.com/docs/components/sidebar.md): `Sidebar` is a component used to display a list of items in a sidebar. - [Bubble](https://yamada-ui.com/docs/components/bubble.md): `Bubble` is a component that displays conversational content in a message bubble. - [DataList](https://yamada-ui.com/docs/components/data-list.md): `DataList` is used to display a list of data items. - [InfiniteScrollArea](https://yamada-ui.com/docs/components/infinite-scroll-area.md): `InfiniteScrollArea` is a component that provides infinite scrolling functionality. This component offers a smooth scrolling experience by automatically loading and displaying the next dataset when the end of the component is reached. - [Link](https://yamada-ui.com/docs/components/link.md): `Link` is a component for creating hyperlinks to different web pages, locations within the same page, or other URLs. - [LinkBox](https://yamada-ui.com/docs/components/link-box.md): `LinkBox` is a component that allows elements such as articles or cards to function as a single link. ## Uses Components & Hooks - [Icon](https://yamada-ui.com/docs/components/icon.md): `Icon` is a general icon component that can be used in your projects.