Breadcrumb
A trail of links from the site root down to the current page.
<arc-breadcrumb>Overview
Breadcrumb shows where the current page sits in the site's hierarchy. Each crumb links to a parent page, and the last crumb is the current page, so users can jump several levels up without pressing Back. Use it next to a sidebar or top bar, not in place of one.
Write the trail as <arc-breadcrumb-item> children. The component renders a <nav> with aria-label="Breadcrumb" (change it with label) and gives the last crumb aria-current="page". The separator character (default /) goes between crumbs and is hidden from screen readers. The crumbs aren't in an <ol> as the WAI-ARIA Breadcrumb pattern has them, so screen readers don't announce them as a list.
Crumbs with an href render as ordinary <a> links. arc-navigate fires only from a crumb before the last that has no href, which renders as a button.
Guidelines
Do
- Put the trail near the top of the page, above the main heading
- Start with the root page ("Dashboard" or "Home")
- Keep crumb labels to one or two words that match the page titles
- Use breadcrumbs in apps with three or more levels
Don't
- Don't make the last crumb a link. It is the page the user is already on
- Don't show a trail on a top-level page. One crumb tells the user nothing
- Don't put breadcrumbs and a back button in the same spot. Pick one
- Don't go past five or six levels. A trail that deep means the site is nested too far
Features
- The current crumb is set apart by color alone: primary text against the muted links
- Long trails wrap onto a second line on narrow screens
Preview
Usage
Its events and state need JavaScript, so use the Web Component or a framework wrapper for those.
<arc-breadcrumb>
<arc-breadcrumb-item href="/dashboard">Dashboard</arc-breadcrumb-item>
<arc-breadcrumb-item href="/dashboard/projects">Projects</arc-breadcrumb-item>
<arc-breadcrumb-item href="/dashboard/projects/arc-ui">ARC UI</arc-breadcrumb-item>
<arc-breadcrumb-item>Settings</arc-breadcrumb-item>
</arc-breadcrumb>import { Breadcrumb, BreadcrumbItem } from '@arclux/arc-ui-react';
export default function Example() {
return (
<Breadcrumb>
<BreadcrumbItem href="/dashboard">Dashboard</BreadcrumbItem>
<BreadcrumbItem href="/dashboard/projects">Projects</BreadcrumbItem>
<BreadcrumbItem href="/dashboard/projects/arc-ui">ARC UI</BreadcrumbItem>
<BreadcrumbItem>Settings</BreadcrumbItem>
</Breadcrumb>
);
}<script setup>
import { Breadcrumb, BreadcrumbItem } from '@arclux/arc-ui-vue';
</script>
<template>
<Breadcrumb>
<BreadcrumbItem href="/dashboard">Dashboard</BreadcrumbItem>
<BreadcrumbItem href="/dashboard/projects">Projects</BreadcrumbItem>
<BreadcrumbItem href="/dashboard/projects/arc-ui">ARC UI</BreadcrumbItem>
<BreadcrumbItem>Settings</BreadcrumbItem>
</Breadcrumb>
</template><script>
import { Breadcrumb, BreadcrumbItem } from '@arclux/arc-ui-svelte';
</script>
<Breadcrumb>
<BreadcrumbItem href="/dashboard">Dashboard</BreadcrumbItem>
<BreadcrumbItem href="/dashboard/projects">Projects</BreadcrumbItem>
<BreadcrumbItem href="/dashboard/projects/arc-ui">ARC UI</BreadcrumbItem>
<BreadcrumbItem>Settings</BreadcrumbItem>
</Breadcrumb>import { Component } from '@angular/core';
import { Breadcrumb, BreadcrumbItem } from '@arclux/arc-ui-angular';
@Component({
imports: [Breadcrumb, BreadcrumbItem],
template: `
<arc-breadcrumb>
<arc-breadcrumb-item href="/dashboard">Dashboard</arc-breadcrumb-item>
<arc-breadcrumb-item href="/dashboard/projects">Projects</arc-breadcrumb-item>
<arc-breadcrumb-item href="/dashboard/projects/arc-ui">ARC UI</arc-breadcrumb-item>
<arc-breadcrumb-item>Settings</arc-breadcrumb-item>
</arc-breadcrumb>
`,
})
export class BreadcrumbDemoComponent {}import { Breadcrumb, BreadcrumbItem } from '@arclux/arc-ui-solid';
export default function BreadcrumbDemo() {
return (
<Breadcrumb>
<BreadcrumbItem href="/dashboard">Dashboard</BreadcrumbItem>
<BreadcrumbItem href="/dashboard/projects">Projects</BreadcrumbItem>
<BreadcrumbItem href="/dashboard/projects/arc-ui">ARC UI</BreadcrumbItem>
<BreadcrumbItem>Settings</BreadcrumbItem>
</Breadcrumb>
);
}import { Breadcrumb, BreadcrumbItem } from '@arclux/arc-ui-preact';
export default function BreadcrumbDemo() {
return (
<Breadcrumb>
<BreadcrumbItem href="/dashboard">Dashboard</BreadcrumbItem>
<BreadcrumbItem href="/dashboard/projects">Projects</BreadcrumbItem>
<BreadcrumbItem href="/dashboard/projects/arc-ui">ARC UI</BreadcrumbItem>
<BreadcrumbItem>Settings</BreadcrumbItem>
</Breadcrumb>
);
}<arc-breadcrumb>
<arc-breadcrumb-item href="/dashboard">Dashboard</arc-breadcrumb-item>
<arc-breadcrumb-item href="/dashboard/projects">Projects</arc-breadcrumb-item>
<arc-breadcrumb-item href="/dashboard/projects/arc-ui">ARC UI</arc-breadcrumb-item>
<arc-breadcrumb-item>Settings</arc-breadcrumb-item>
</arc-breadcrumb><!-- arc-breadcrumb is hybrid — CSS handles layout, JS enhances interactivity -->
<arc-breadcrumb></arc-breadcrumb>API
separatorstring'/'- Character used as the separator between breadcrumb items. Common options: '/', '>', '•'.
labelstring'Breadcrumb'
Events
arc-navigate- Fired when a breadcrumb item is clicked
See also
- PaginationPrevious and next buttons around numbered page buttons, with ellipses when there are too many pages to show.
- Navigation MenuHorizontal navigation bar whose top-level items open dropdowns of links on hover or click. Each link can carry a one-line description.
- LinkA styled anchor with default, muted and nav variants.