Breadcrumb
Navigation breadcrumb trail with custom separators and responsive collapse.
Rendering Breadcrumb…
Installation
Copy the source into your project with the CLI. It lands under @/components/ui and is yours to edit.
npx mlola-ui add breadcrumbUsage
import { Breadcrumb } from "@/components/ui/breadcrumb";
export default function Example() {
return (
<Breadcrumb
items={[
{ label: "Projects", href: "/projects" },
{ label: "Atlas", href: "/projects/atlas" },
{ label: "Settings" },
]}
/>
);
}Styling comes from the engine stylesheet and the nearest theme. Set it once at the root:
<html data-theme="graphite" data-mode="light">HTML
The markup the example above renders, exactly. It needs no script: write it from any language or template.
<nav class="ml-breadcrumb" aria-label="Breadcrumb">
<ol class="ml-breadcrumb-list">
<li class="ml-breadcrumb-item">
<a class="ml-breadcrumb-link" data-hit="expand" href="/projects">Projects</a>
<span class="ml-breadcrumb-separator" aria-hidden="true"><svg class="mlola-glyph" width="1em" height="1em" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="var(--mlola-glyph-stroke, var(--ml-icon-stroke, 1.75))" stroke-linecap="round" stroke-linejoin="round" focusable="false" aria-hidden="true" data-optical-size="default" style="color:var(--mlola-glyph-color, currentColor);scale:var(--mlola-glyph-optical-scale, 1);transform-origin:center"><path d="m9 18 6-6-6-6" pathLength="1"></path></svg></span>
</li>
<li class="ml-breadcrumb-item">
<a class="ml-breadcrumb-link" data-hit="expand" href="/projects/atlas">Atlas</a>
<span class="ml-breadcrumb-separator" aria-hidden="true"><svg class="mlola-glyph" width="1em" height="1em" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="var(--mlola-glyph-stroke, var(--ml-icon-stroke, 1.75))" stroke-linecap="round" stroke-linejoin="round" focusable="false" aria-hidden="true" data-optical-size="default" style="color:var(--mlola-glyph-color, currentColor);scale:var(--mlola-glyph-optical-scale, 1);transform-origin:center"><path d="m9 18 6-6-6-6" pathLength="1"></path></svg></span>
</li>
<li class="ml-breadcrumb-item">
<span class="ml-breadcrumb-page" aria-current="page">Settings</span>
</li>
</ol>
</nav>Classes and attributes
A class names each element; data-* and aria-* attributes carry its variant and state. The values listed are the ones the stylesheet draws; the default needs no attribute.
| Class | Attributes |
|---|---|
ml-breadcrumb | — |
ml-breadcrumb-list | — |
ml-breadcrumb-item | data-collapse-indicatordata-collapsible |
ml-breadcrumb-link | — |
ml-breadcrumb-page | — |
ml-breadcrumb-icon | — |
ml-breadcrumb-separator | — |
ml-breadcrumb-ellipsis | — |
Accessibility and theming
- Semantic elements, accessible names and state relationships are part of the contract.
- Keyboard, pointer and touch paths are operable; focus stays visible in every theme.
- Light and dark modes pass WCAG AA contrast in all 5 canonical themes.
- Reduced motion and forced colors keep meaning and operation.
Dependencies
Installed alongside this component. No third-party UI runtime is ever added.
@mlola-ui/icons