Web · Components
Breadcrumb
Breadcrumb showing where the user is on the site (Home › Products › Phones).
4 exports
Live example
Preview
Code
Events
- Events appear here when you interact with the preview.
Short path, slash separator
Long path: maxItems={4}, the middle in the (…) menu
Project switcher: the current page without a link opens a menu
Only "‹ parent page" on phones (mobile="back")
Import
Breadcrumb showing where the user is on the site (Home › Products › Phones). Pages are given with the items array; the last item is the current page.
- Server component: used directly in Next.js pages; only links and menus run on the client. Links are drawn with the
linkcomponent given toUIProvider(Next.jsLink). - Accessibility: an ordered list inside
<nav aria-label>; the current page getsaria-current="page"and separators are hidden from screen readers. - Long paths: with
maxItemsthe middle pages are collected into the (…) menu; the menu is the existingMenucomponent. Pages that don't fit wrap to the next line and very long texts are truncated. - Sibling pages: when an item has
menu, the arrow next to it switches to pages at the same level (e.g. a project switcher). - SEO:
structuredDataadds theBreadcrumbListdata Google shows in search results. - Mobile: on small screens the first page, (…) and the last two pages are visible by default; the (…) menu is an action sheet opening from the bottom.
mobile="back"shows only a "‹ Parent page" link. Links have a touch area at least 44 px tall. All done with CSS; no measuring or re-rendering.
Examples
BreadcrumbItem
interfaceA page in the Breadcrumb items array.
| Name | Type | Description |
|---|---|---|
label | ReactNode | Page name. |
href? | string | Page URL. Internal URLs are drawn with the link component given to UIProvider (e.g. Next.js Link). When omitted the item is plain text. |
icon? | IconProp | Icon at the start of the text: a name ("home") or an element. |
iconOnly? | boolean | Shows only the icon; the text is read to screen readers and shown as a tooltip (e.g. a home icon for the home page). |
current? | boolean | Is it the current page? When omitted the last item is the current page. The current page gets aria-current="page" and isn't a link unless href is given. |
menu? | readonly MenuEntry[] | Menu to switch to this page's siblings (e.g. changing project or category). On a linked item a small arrow appears next to the text; on an unlinked item the text itself opens the menu. See MenuEntry. |
tooltip? | TooltipProp | Tooltip shown on hover or focus. For an iconOnly item label is shown when omitted. See TooltipProp. |
BreadcrumbMobile
typeBreadcrumb behavior on small screens (below 640 px).
"collapse": the first page, the (…) menu opening hidden pages, and the last two pages are visible."back": only a "‹ Parent page" link going one level up is visible (as in iOS/Android apps)."full": same as desktop; pages that don't fit wrap to the next line.
BreadcrumbProps
interfaceProps of the Breadcrumb component.
Extends: Omit<ComponentProps<"nav">, "children">
| Name | Type | Default | Description |
|---|---|---|---|
items | readonly BreadcrumbItem[] | Pages from the root to the current page. | |
separator? | ReactNode | Right-pointing chevron (›) | Separator between pages. A string ("/", "·") or an element. |
maxItems? | number | Maximum number of pages visible on desktop. The rest are collected into the (…) menu after the first page; the first page and the last maxItems - 1 pages stay visible. All are visible when omitted. | |
mobile? | BreadcrumbMobile | "collapse" | Behavior on small screens. See BreadcrumbMobile. |
structuredData? | boolean | string | Adds BreadcrumbList structured data (JSON-LD) for search engines. When a string is given, relative URLs are made absolute against this root (e.g. "https://example.com"); Google requires absolute URLs. Only labels that are text are included. | |
label? | string | the `breadcrumb` text (`"Sayfa yolu"`) | Screen reader name of the navigation region. |
effect? | EffectProp | Effect or effects of the page links (e.g. "scale", "border"). Defaults to UIProvider appearance.defaults.breadcrumb.effect. See BuiltinEffect. |