Breadcrumbs
import {Breadcrumbs} from "@qualcomm-ui/react/breadcrumbs"Overview
- The root component should be labeled with
aria-label="Breadcrumbs"to indicate that it's a breadcrumb navigation. - The first breadcrumb item is always the root item, and is typically reserved for the home page or base route of your application.
- The last breadcrumb item is always the active item.
- The last breadcrumb item should always be annotated with the
aria-current="page"attribute.
Examples
Emphasis (color)
Use the emphasis prop to change the color of the breadcrumbs.
Qualcomm
<Breadcrumbs.Root aria-label="Breadcrumbs">
<Breadcrumbs.List>
<Breadcrumbs.Item icon={Home}>Home</Breadcrumbs.Item>
<Breadcrumbs.Item>Components</Breadcrumbs.Item>
<Breadcrumbs.Item aria-current="page">Breadcrumbs</Breadcrumbs.Item>
</Breadcrumbs.List>
</Breadcrumbs.Root>
<Breadcrumbs.Root aria-label="Breadcrumbs" emphasis="neutral">
<Breadcrumbs.List>
<Breadcrumbs.Item icon={Home}>Home</Breadcrumbs.Item>
<Breadcrumbs.Item>Components</Breadcrumbs.Item>
<Breadcrumbs.Item aria-current="page">Breadcrumbs</Breadcrumbs.Item>
</Breadcrumbs.List>
</Breadcrumbs.Root>Sizes
Three sizes are available via the size prop: sm, md, and lg. The default size is md.
Qualcomm
<Breadcrumbs.Root aria-label="Breadcrumbs" size="sm">
<Breadcrumbs.List>
<Breadcrumbs.Item icon={Home}>Home</Breadcrumbs.Item>
<Breadcrumbs.Item>Components</Breadcrumbs.Item>
<Breadcrumbs.Item aria-current="page">Breadcrumbs</Breadcrumbs.Item>
</Breadcrumbs.List>
</Breadcrumbs.Root>
<Breadcrumbs.Root aria-label="Breadcrumbs" size="md">
<Breadcrumbs.List>
<Breadcrumbs.Item icon={Home}>Home</Breadcrumbs.Item>
<Breadcrumbs.Item>Components</Breadcrumbs.Item>
<Breadcrumbs.Item aria-current="page">Breadcrumbs</Breadcrumbs.Item>
</Breadcrumbs.List>
</Breadcrumbs.Root>
<Breadcrumbs.Root aria-label="Breadcrumbs" size="lg">
<Breadcrumbs.List>
<Breadcrumbs.Item icon={Home}>Home</Breadcrumbs.Item>
<Breadcrumbs.Item>Components</Breadcrumbs.Item>
<Breadcrumbs.Item aria-current="page">Breadcrumbs</Breadcrumbs.Item>
</Breadcrumbs.List>
</Breadcrumbs.Root>Links
Use the render prop on the <Breadcrumbs.Item> component to change the root element to your framework's link component. The following example uses React Router:
Qualcomm
<Breadcrumbs.Root aria-label="Breadcrumbs">
<Breadcrumbs.List>
<Breadcrumbs.Item icon={Home} render={<Link to="/" />}>
Home
</Breadcrumbs.Item>
<Breadcrumbs.Item render={<Link to="/components" />}>
Components
</Breadcrumbs.Item>
<Breadcrumbs.Item
aria-current="page"
render={<Link to="/components/breadcrumbs" />}
>
Breadcrumbs
</Breadcrumbs.Item>
</Breadcrumbs.List>
</Breadcrumbs.Root>Disabled Item
Use the disabled prop to disable a breadcrumb item.
Qualcomm
<Breadcrumbs.Item disabled>Components</Breadcrumbs.Item>Shortcuts
Item
The Breadcrumbs.Item component is a convenient shorthand for rendering each part of the breadcrumb item. It's equivalent to the following:
<Breadcrumbs.ItemRoot {...props}>
<Breadcrumbs.ItemTrigger
aria-current={ariaCurrent}
render={render}
{...itemTriggerProps}
>
{icon ? <Breadcrumbs.ItemIcon icon={icon} {...itemIconProps} /> : null}
{children}
</Breadcrumbs.ItemTrigger>
<Breadcrumbs.ItemSeparator icon={separator} {...separatorProps} />
</Breadcrumbs.ItemRoot>API
<Breadcrumbs.Root>
| Prop | Type | Default |
|---|---|---|
Governs the color of the breadcrumb item text and icon. | | 'primary' | 'primary' |
Allows you to replace the component's HTML element with a different tag or component. Learn more | | ReactElement | |
Governs the size of the breadcrumb item text and icon. | | 'sm' | 'md' |
Type
| 'primary'
| 'neutral'
Description
Governs the color of the breadcrumb item text and icon.
Type
| ReactElement
| ((
props: object,
) => ReactElement)
Description
Allows you to replace the component's HTML element with a different tag or component. Learn more
Type
| 'sm'
| 'md'
| 'lg'
Description
Governs the size of the breadcrumb item text and icon.
| Attribute / Property | Value |
|---|---|
className | 'qui-breadcrumbs__root' |
data-size | | 'sm' |
classNameValue
'qui-breadcrumbs__root'data-sizeValue
| 'sm'
| 'md'
| 'lg'
<Breadcrumbs.List>
The list of breadcrumbs. Renders an
<ol> element by default.| Prop | Type |
|---|---|
Allows you to replace the component's HTML element with a different tag or component. Learn more | | ReactElement |
Type
| ReactElement
| ((
props: object,
) => ReactElement)
Description
Allows you to replace the component's HTML element with a different tag or component. Learn more
| Attribute / Property | Value |
|---|---|
className | 'qui-breadcrumbs__list' |
classNameValue
'qui-breadcrumbs__list'<Breadcrumbs.Item>
| Prop | Type | Default |
|---|---|---|
The aria-current attribute, should be set to page when the item is
the current page. | 'page' | |
Controls the component's interactivity. If true, the component becomes
unresponsive to input and is visually dimmed to indicate its disabled state. | boolean | |
The icon to display next to the item trigger. | | LucideIcon | |
Props applied to the item icon element. | ||
Props applied to the item trigger element. | ||
Allows you to replace the component's HTML element with a different tag, or
compose it with another component. Learn more | | Element | |
The separator element to render between items. | | LucideIcon | ChevronRight |
Props applied to the separator element. |
Type
'page'Description
The
aria-current attribute, should be set to page when the item is
the current page.Type
booleanDescription
Controls the component's interactivity. If
true, the component becomes
unresponsive to input and is visually dimmed to indicate its disabled state.Type
| LucideIcon
| ReactNode
Description
The icon to display next to the item trigger.
Description
Props applied to the item icon element.
Description
Props applied to the item trigger element.
Type
| Element
| ((
props: object,
) => Element)
Description
Allows you to replace the component's HTML element with a different tag, or
compose it with another component. Learn more
Type
| LucideIcon
| ReactNode
Description
The separator element to render between items.
Description
Props applied to the separator element.
| Attribute / Property | Value |
|---|---|
className | 'qui-breadcrumbs__item' |
data-disabled |
classNameValue
'qui-breadcrumbs__item'data-disabledValue
<Breadcrumbs.ItemIcon>
| Prop | Type |
|---|---|
icon * The icon or element to render before the item. | | LucideIcon |
Allows you to replace the component's HTML element with a different tag or component. Learn more | | ReactElement |
icon
*
Type
| LucideIcon
| ReactNode
Description
The icon or element to render before the item.
Type
| ReactElement
| ((
props: object,
) => ReactElement)
Description
Allows you to replace the component's HTML element with a different tag or component. Learn more
| Attribute / Property | Value |
|---|---|
className | 'qui-breadcrumbs__item-icon' |
data-emphasis | | 'primary' |
data-size | | 'sm' |
classNameValue
'qui-breadcrumbs__item-icon'data-emphasisValue
| 'primary'
| 'neutral'
data-sizeValue
| 'sm'
| 'md'
| 'lg'
<Breadcrumbs.ItemTrigger>
| Prop | Type |
|---|---|
Allows you to replace the component's HTML element with a different tag or component. Learn more | | ReactElement |
Type
| ReactElement
| ((
props: object,
) => ReactElement)
Description
Allows you to replace the component's HTML element with a different tag or component. Learn more
| Attribute / Property | Value |
|---|---|
className | 'qui-breadcrumbs__item-trigger' |
data-emphasis | | 'primary' |
data-size | | 'sm' |
classNameValue
'qui-breadcrumbs__item-trigger'data-emphasisValue
| 'primary'
| 'neutral'
data-sizeValue
| 'sm'
| 'md'
| 'lg'
<Breadcrumbs.ItemSeparator>
| Prop | Type | Default |
|---|---|---|
The separator element to render between items. | | LucideIcon | ChevronRight |
Allows you to replace the component's HTML element with a different tag or component. Learn more | | ReactElement |
Type
| LucideIcon
| ReactNode
Description
The separator element to render between items.
Type
| ReactElement
| ((
props: object,
) => ReactElement)
Description
Allows you to replace the component's HTML element with a different tag or component. Learn more
| Attribute / Property | Value |
|---|---|
className | 'qui-breadcrumbs__separator' |
data-size | | 'sm' |
classNameValue
'qui-breadcrumbs__separator'data-sizeValue
| 'sm'
| 'md'
| 'lg'
<nav>element by default.