Breadcrumbs shows hierarchy and navigational path to the current page. Supports icons and custom separators.
Basic Usage
Navigation breadcrumb trail with multiple syntaxes.
await import('/components/navigation/breadcrumbs.js');
const { tags, $ } = Lightview;
const { Breadcrumbs } = tags;
const path = [
{ label: 'Home', href: '/' },
{ label: 'Products', href: '/products' },
{ label: 'Electronics', href: '/products/electronics' },
{ label: 'Phones' } // Current page (no href)
];
const breadcrumbs = Breadcrumbs({ style: 'font-size: 0.75rem' },
...path.map(item =>
item.href
? Breadcrumbs.Item({ href: item.href }, item.label)
: Breadcrumbs.Item({}, item.label)
)
);
$('#example').content(breadcrumbs);
Props
| Prop | Type | Default | Description |
|---|---|---|---|
class |
string | - | Additional classes (text-sm, text-lg) |
Sub-components
| Component | Props | Description |
|---|---|---|
Breadcrumbs.Item |
href | Individual breadcrumb item |
Breadcrumbs Gallery
Live examples using <lv-breadcrumbs> and
<lv-breadcrumbs-item> custom elements.