<vega-breadcrumb max-items="5" />
document.querySelector('vega-breadcrumb').items = [
{ label: 'Home', href: '' },
{ label: 'level2', href: '' },
{ label: 'level3', href: '' },
{ label: 'level4', href: '' },
{ label: 'level5', href: '', tooltip: 'level 5 tooltip' },
];
Breadcrumbs are a navigational tool on complex websites that help users find their way through the site. They are useful for users who may have arrived at a page through a search or other means, and may not know the context of the page within the architecture of the site. Breadcrumbs are typically shown at the top of the page, under the navigation bar.
Name | Description | Default |
---|---|---|
items | The item array for the breadcrumbs. VegaBreadcrumbItemType[] |
[] |
max-items | The maxiumum number of breadcrumbs. The min value of maxItems is 4. number’none’ |
4 |
export type VegaBreadcrumbCollapsedThresholdType = number | 'none';
export type VegaBreadcrumbItemType = {
label: string,
href: string,
tooltip?: string,
};
vegaClick
When an item has been clicked, if it has a set href
property, the window location will be changed to the set value. If this property is not set, a vegaClick
event will be emitted.
maxItems
, the breadcrumbs will collapse and render only the first and last items. maxItems
is set to none
, all items will be displayed.max-items
is 4. If this is set to less than 4, the collapsed function will not work.tooltip
key for an individual item property, the set value will be displayed as a tooltip.