Basic Components
[02] Basic Components
Breadcrumb
Breadcrumb shows where a page sits in the site: a labelled nav with an ordered list of links that ends at the current page, marked with aria-current.
Breadcrumb shows where the current page sits in the site's hierarchy, as a trail of links from the top level down to the page itself. It renders a <nav> landmark labelled "Breadcrumb" around an ordered list, one <li> per BreadcrumbItem, with a chevron between items that assistive technology skips. For the main navigation of a site or a section, use NavLink in a sidebar or tab bar. Breadcrumb needs @vaneui/ui 1.8.0 or later.
Basic usage
Each BreadcrumbItem with href renders a link. An item without href renders text. The last item is the current page: it gets aria-current="page" and the stronger text color.
<Breadcrumb> <BreadcrumbItem href="#home">Home</BreadcrumbItem> <BreadcrumbItem href="#docs">Docs</BreadcrumbItem> <BreadcrumbItem href="#components">Components</BreadcrumbItem> <BreadcrumbItem>Breadcrumb</BreadcrumbItem></Breadcrumb>sm, secondary and outline are defaults, so a bare Breadcrumb has 14px text in the secondary text color, one step below body text.
Marking the current page
When the current page is not the last item, for example in a trail that ends with a tab or a filter, set current on that item. An item with current={false} opts out, so a trail can mark no item at all.
<Col> <Breadcrumb> <BreadcrumbItem href="#settings">Settings</BreadcrumbItem> <BreadcrumbItem href="#billing" current>Billing</BreadcrumbItem> <BreadcrumbItem href="#invoices">Invoices</BreadcrumbItem> </Breadcrumb> <Breadcrumb> <BreadcrumbItem href="#settings">Settings</BreadcrumbItem> <BreadcrumbItem href="#billing" current={false}>Billing</BreadcrumbItem> </Breadcrumb></Col>Separators
separator replaces the chevron with any node: a character, an icon or an element of your own. The separator is drawn before every item but the first, in the tertiary text color, and is hidden from assistive technology.
<Col> <Breadcrumb separator="/"> <BreadcrumbItem href="#home">Home</BreadcrumbItem> <BreadcrumbItem href="#projects">Projects</BreadcrumbItem> <BreadcrumbItem>vaneui</BreadcrumbItem> </Breadcrumb> <Breadcrumb separator="·"> <BreadcrumbItem href="#home">Home</BreadcrumbItem> <BreadcrumbItem href="#blog">Blog</BreadcrumbItem> <BreadcrumbItem>Release notes</BreadcrumbItem> </Breadcrumb></Col>Sizes
The size prop on Breadcrumb sets the text, the separator and the gap between items for the whole trail.
<Col> <Breadcrumb xs> <BreadcrumbItem href="#home">Home</BreadcrumbItem> <BreadcrumbItem>xs</BreadcrumbItem> </Breadcrumb> <Breadcrumb> <BreadcrumbItem href="#home">Home</BreadcrumbItem> <BreadcrumbItem>sm</BreadcrumbItem> </Breadcrumb> <Breadcrumb md> <BreadcrumbItem href="#home">Home</BreadcrumbItem> <BreadcrumbItem>md</BreadcrumbItem> </Breadcrumb> <Breadcrumb lg> <BreadcrumbItem href="#home">Home</BreadcrumbItem> <BreadcrumbItem>lg</BreadcrumbItem> </Breadcrumb> <Breadcrumb xl> <BreadcrumbItem href="#home">Home</BreadcrumbItem> <BreadcrumbItem>xl</BreadcrumbItem> </Breadcrumb></Col>Appearances
An appearance on Breadcrumb colors the links and the current page. The default secondary keeps the trail quieter than the page title under it.
<Col> <Breadcrumb primary> <BreadcrumbItem href="#home">Home</BreadcrumbItem> <BreadcrumbItem>Primary</BreadcrumbItem> </Breadcrumb> <Breadcrumb accent> <BreadcrumbItem href="#home">Home</BreadcrumbItem> <BreadcrumbItem>Accent</BreadcrumbItem> </Breadcrumb> <Breadcrumb info> <BreadcrumbItem href="#home">Home</BreadcrumbItem> <BreadcrumbItem>Info</BreadcrumbItem> </Breadcrumb></Col>Long trails on narrow screens
The list wraps, and each item keeps its text on one line, so a long trail breaks between items rather than inside one. The separator stays with the item that follows it.
<Card className="max-w-xs"> <Breadcrumb> <BreadcrumbItem href="#home">Home</BreadcrumbItem> <BreadcrumbItem href="#docs">Documentation</BreadcrumbItem> <BreadcrumbItem href="#components">Form components</BreadcrumbItem> <BreadcrumbItem>Field sections</BreadcrumbItem> </Breadcrumb></Card>A page header with a breadcrumb
Put the Breadcrumb above the page title, so the trail reads first and the title names the last item.
<Col> <Breadcrumb> <BreadcrumbItem href="#projects">Projects</BreadcrumbItem> <BreadcrumbItem href="#website">Website</BreadcrumbItem> <BreadcrumbItem>Settings</BreadcrumbItem> </Breadcrumb> <PageTitle>Settings</PageTitle></Col>Next.js Link integration
Pass the router's link component through tag, like on Button and NavLink. The item keeps its styles and aria-current, and the router handles the click:
import Link from "next/link";
<Breadcrumb> <BreadcrumbItem tag={Link} href="/">Home</BreadcrumbItem> <BreadcrumbItem tag={Link} href="/docs">Docs</BreadcrumbItem> <BreadcrumbItem>Button</BreadcrumbItem></Breadcrumb>Customizing
Breadcrumb has four theme nodes: breadcrumb.main (the <nav>), breadcrumb.list (the <ol>), breadcrumb.item (each link or text) and breadcrumb.separator.
<ThemeProvider themeDefaults={{ breadcrumb: { main: { md: true }, item: { fontMedium: true } },}}> <Breadcrumb> <BreadcrumbItem href="#home">Home</BreadcrumbItem> <BreadcrumbItem>Customized</BreadcrumbItem> </Breadcrumb></ThemeProvider>Frequently asked questions
Should the last item be a link?
No. The last item is the page you are on, so a link to it goes nowhere. Leave out its href, and it renders as text with aria-current="page". Give it an href only when the item stands for a parent view, such as a list the current page was opened from.
How do I translate the "Breadcrumb" label?
Pass aria-label on Breadcrumb, for example aria-label="Fil d'Ariane". It replaces the default label of the <nav> landmark, which screen reader users hear when they move between landmarks.
Can a page have more than one Breadcrumb?
It can, but each <nav> landmark then needs a label of its own, such as "Breadcrumb" and "Related sections", so screen reader users can tell them apart. Most pages need one trail, at the top of the main content.
Breadcrumb Props
| Prop | Category | Default | Description |
|---|---|---|---|
accent | Appearance | Accent color appearance (rose) | |
danger | Appearance | Danger color appearance (red) | |
info | Appearance | Info color appearance (cyan) | |
inheritAppearance | Appearance | Inherit appearance from parent — suppresses own data-appearance/data-variant, uses parent's CSS variables | |
primary | Appearance | Primary color appearance (gray) | |
secondary | Appearance | ✓ | Secondary color appearance (gray) |
success | Appearance | Success color appearance (green) | |
tertiary | Appearance | Tertiary color appearance | |
warning | Appearance | Warning color appearance (amber) | |
fontHeading | Font Family | Heading font family (defaults to sans, customizable via --font-heading) — emits font-heading | |
fontMono | Font Family | Monospace font family — emits font-mono | |
fontSans | Font Family | ✓ | Sans-serif font family (default) — emits font-sans |
fontSerif | Font Family | Serif font family — emits font-serif | |
fontBlack | Font Weight | Black font weight (900) — emits font-black | |
fontBold | Font Weight | Bold font weight (700) — emits font-bold | |
fontExtrabold | Font Weight | Extra bold font weight (800) — emits font-extrabold | |
fontExtralight | Font Weight | Extra light font weight (200) — emits font-extralight | |
fontLight | Font Weight | Light font weight (300) — emits font-light | |
fontMedium | Font Weight | Medium font weight (500) — emits font-medium | |
fontNormal | Font Weight | Normal font weight (400) — emits font-normal | |
fontSemibold | Font Weight | Semibold font weight (600) — emits font-semibold | |
fontThin | Font Weight | Thin font weight (100) — emits font-thin | |
margin | Margin | Enable margin on all sides | |
marginB | Margin | Enable only bottom margin | |
marginT | Margin | Enable only top margin | |
marginX | Margin | Enable only horizontal (inline) margin | |
marginY | Margin | Enable only vertical (block) margin | |
noMargin | Margin | Disable margin (reset to 0) | |
lg | Size | Large size | |
md | Size | Medium size (default) | |
sm | Size | ✓ | Small size |
xl | Size | Extra large size | |
xs | Size | Extra small size | |
skeleton | Skeleton | Show the component as a loading placeholder in its own size and shape. On a container, every component inside it becomes a placeholder too | |
filled | Variant | Filled variant - solid background with contrasting text color | |
ghost | Variant | Ghost variant - transparent background, no border, appearance-colored text, tinted hover background | |
outline | Variant | ✓ | Outline variant - transparent background with border and colored text (default) |
Layout & utility props (gap, padding, hide, items, justify, ...)
Documented on Common Props.
| Prop | Category | Default | Description |
|---|---|---|---|
block | Display | Block display - takes full width, new line | |
contents | Display | Contents display - element's box is removed, children display as if parent didn't exist | |
flex | Display | Flex display - flexbox container | |
grid | Display | Grid display - CSS grid container | |
hidden | Display | Hidden display - element is not visible | |
inline | Display | Inline display - flows with text | |
inlineBlock | Display | Inline-block display - inline but with block properties | |
inlineFlex | Display | Inline-flex display - inline flexbox container | |
inlineGrid | Display | Inline-grid display - inline grid container | |
table | Display | Table display - behaves like table element | |
tableCell | Display | Table-cell display - behaves like td element | |
desktopHide | Hide | Hide element on desktop devices and below (max-desktop: 80rem) | |
mobileHide | Hide | Hide element on mobile devices and below (max-mobile: 48rem) | |
tabletHide | Hide | Hide element on tablet devices and below (max-tablet: 64rem) | |
itemsBaseline | Items | Align items to baseline | |
itemsCenter | Items | Align items to center | |
itemsEnd | Items | Align items to end (bottom/right) | |
itemsStart | Items | Align items to start (top/left) | |
itemsStretch | Items | Stretch items to fill container | |
justifyAround | Justify | Distribute items with space around them | |
justifyBaseline | Justify | Align items along their baseline on main axis | |
justifyBetween | Justify | Distribute items with space between them | |
justifyCenter | Justify | Center items along the main axis | |
justifyEnd | Justify | Pack items toward the end of the main axis | |
justifyEvenly | Justify | Distribute items with equal space around them | |
justifyStart | Justify | Pack items toward the start of the main axis | |
justifyStretch | Justify | Stretch items to fill the main axis | |
overflowAuto | Overflow | Auto overflow - show scrollbars if needed | |
overflowClip | Overflow | Clip overflow - hard clip without scrollbars | |
overflowHidden | Overflow | Hidden overflow - clip content without scrollbars | |
overflowScroll | Overflow | Scroll overflow - always show scrollbars | |
overflowVisible | Overflow | Visible overflow - content extends beyond bounds | |
overflowXAuto | Overflow | Auto overflow on X-axis only | |
overflowXClip | Overflow | Clip overflow on X-axis only | |
overflowXHidden | Overflow | Hidden overflow on X-axis only | |
overflowXScroll | Overflow | Scroll overflow on X-axis only | |
overflowXVisible | Overflow | Visible overflow on X-axis only | |
overflowYAuto | Overflow | Auto overflow on Y-axis only | |
overflowYClip | Overflow | Clip overflow on Y-axis only | |
overflowYHidden | Overflow | Hidden overflow on Y-axis only | |
overflowYScroll | Overflow | Scroll overflow on Y-axis only | |
overflowYVisible | Overflow | Visible overflow on Y-axis only | |
absolute | Position | Absolute positioning | |
fixed | Position | Fixed positioning | |
relative | Position | Relative positioning | |
static | Position | Static positioning | |
sticky | Position | Sticky positioning at the top edge; set --sticky-top to stick below a fixed header | |
desktopShow | Show | Show element only on desktop and below, below 1280px (hidden from 80rem up) | |
mobileShow | Show | Show element only on mobile, below 768px (hidden from 48rem up) | |
tabletShow | Show | Show element only on tablet and below, below 1024px (hidden from 64rem up) |
BreadcrumbItem Props
| Prop | Category | Default | Description |
|---|---|---|---|
fontBlack | Font Weight | Black font weight (900) — emits font-black | |
fontBold | Font Weight | Bold font weight (700) — emits font-bold | |
fontExtrabold | Font Weight | Extra bold font weight (800) — emits font-extrabold | |
fontExtralight | Font Weight | Extra light font weight (200) — emits font-extralight | |
fontLight | Font Weight | Light font weight (300) — emits font-light | |
fontMedium | Font Weight | Medium font weight (500) — emits font-medium | |
fontNormal | Font Weight | Normal font weight (400) — emits font-normal | |
fontSemibold | Font Weight | Semibold font weight (600) — emits font-semibold | |
fontThin | Font Weight | Thin font weight (100) — emits font-thin |
Layout & utility props (gap, padding, hide, items, justify, ...)
Documented on Common Props.
| Prop | Category | Default | Description |
|---|---|---|---|
cursorDefault | Cursor | Default cursor - standard arrow | |
cursorMove | Cursor | Move cursor - indicates draggable element | |
cursorNone | Cursor | No cursor - hides the cursor | |
cursorNotAllowed | Cursor | Not-allowed cursor - indicates disabled state | |
cursorPointer | Cursor | Pointer cursor - indicates clickable element | |
cursorText | Cursor | Text cursor - indicates selectable text | |
cursorWait | Cursor | Wait cursor - indicates loading/processing | |
focusVisible | Focus Visible | ✓ | Enable focus-visible outline |
noFocusVisible | Focus Visible | Disable focus-visible outline | |
noTransition | Transition | Disable transitions for instant state changes | |
transition | Transition | ✓ | Enable smooth transitions between states |
whitespaceBreakSpaces | Whitespace | Preserve whitespace incl. trailing spaces, wrap text (white-space: break-spaces) | |
whitespaceNormal | Whitespace | Normal wrapping - default browser behavior | |
whitespaceNowrap | Whitespace | ✓ | No wrap - text stays on single line |
whitespacePre | Whitespace | Preserve whitespace and line breaks | |
whitespacePreLine | Whitespace | Preserve line breaks, collapse spaces, wrap text | |
whitespacePreWrap | Whitespace | Preserve whitespace, wrap text |