Breadcrumb
vig-breadcrumb
import { Breadcrumb } from '@vigdx/ui/breadcrumb';Basic
items , from the root to the current page. Items with an href render as links, icon adds a registered icon such as home , and the last item is always the current page.
Collapsed
maxItems keeps the first item and the last maxItems - 1 , hiding the middle behind an ellipsis button that reveals the full trail. separator takes any registered icon name.
Item click
href render as buttons; handle itemClick to navigate in code, e.g. with the router or in a master–detail view. disabled items show as plain text.
Styling hooks
Internal elements carry a stable data-part and the component's data-scope; both are public API, so removing one is a breaking change. Select a part by both, e.g. [data-scope="breadcrumb"][data-part="list"] { … }: the pair stays within this component when kit components nest, and also reaches parts in overlay panels, which render outside the host. State is exposed through aria-* and, where listed, a data-state; literal values are checked by the API gate, values computed from the component's state follow its documented types. Other data-* attributes listed below (such as data-opening while an overlay animates) are API too. See Customizing.
Scope: [data-scope="breadcrumb"]
| Part | Element | data-state |
|---|---|---|
list | <ol> . | — |
item | <li> . | — |
separator | — | |
link | current, disabled | |
expand | maxItems ). | — |
Accessibility
- Follows the WAI-ARIA APG breadcrumb pattern: a
<nav>landmark around an ordered list. Its name defaults to the localized “Breadcrumb”; override it withariaLabelwhen a page holds more than one trail. - The last item carries
aria-current="page", so it is announced as the current page. With anhrefit stays a link, keeping the trail one consistent list of links; without one it is plain text. In forced-colors mode it is underlined, since its bolder weight is the only other cue. - Separators and icons are decorative and hidden from assistive technology; the separator mirrors in right-to-left layouts.
- The ellipsis is a button named by
expandAriaLabel. Activating it reveals the hidden items and moves focus to the first of them.
API
Breadcrumb
vig-breadcrumbTrail of links to the current page: <nav><ol><li>, the last item marked
aria-current="page" — still a link when it has an href, plain text
otherwise. With maxItems the middle collapses
into an ellipsis button that reveals the full trail.
<vig-breadcrumb [items]="[{ label: 'Home', href: '/' }, { label: 'Parks' }]" />| Name | Type | Default | Description |
|---|---|---|---|
ariaLabel | string | undefined | undefined | — |
expandAriaLabel | string | undefined | undefined | — |
items | readonly BreadcrumbItem[] | [] | — |
maxItems | number | undefined | undefined | Collapses the middle of longer trails into an ellipsis (minimum 2). |
separator | string | 'chevron-right' | Registered |
| Name | Payload | Description |
|---|---|---|
itemClick | BreadcrumbItem | Activation of any interactive item: a link (the current page's too) or a button. |