Breadcrumb provides contextual information about page hierarchy.
import { BreadcrumbModule } from 'primeng/breadcrumb';
Breadcrumb provides contextual information about page hierarchy.
<p-breadcrumb class="max-w-full" [model]="items" [home]="home"></p-breadcrumb>
Following is the list of structural style classes, for theming classes visit theming page.
Name | Element |
---|---|
p-breadcrumb | Container element. |
p-menuitem | Menuitem element. |
p-menuitem-text | Label of a menuitem. |
p-breadcrumb-chevron | Chevron element. |
Breadcrumb uses the nav element and since any attribute is passed to the root implicitly aria-labelledby or aria-label can be used to describe the component. Inside an ordered list is used where the list item separators have aria-hidden to be able to ignored by the screen readers. If the last link represents the current route, aria-current is added with "page" as the value.
No special keyboard interaction is needed, all menuitems are focusable based on the page tab sequence.
API defines helper props, events and others for the PrimeNG Breadcrumb module.
Name | Type | Default | Description |
---|---|---|---|
model | array | null | An array of menuitems. |
home | MenuItem | null | MenuItem configuration for the home icon. |
style | string | null | Inline style of the component. |
styleClass | string | null | Style class of the component. |
homeAriaLabel | string | null | Defines a string that labels the home icon for accessibility. |
Name | Parameters |
---|---|
separator | - |
Name | Parameters | Description |
---|---|---|
onItemClick | originalEvent: Browser event item: Selected menu item | Fired when an item is selected. |
Name | Parameters | Description |
---|---|---|
onItemClick | originalEvent: Browser event item: Selected menu item | Fired when an item is selected. |
MenuItem provides the following properties. Note that not all of them may be utilized by the breadcrumb component.
Name | Type | Default | Description |
---|---|---|---|
id | string | null | Identifier of the element. |
label | string | null | Text of the item. |
icon | string | null | Icon of the item. |
iconStyle | object | null | Inline style of the item's icon. |
command | function | null | Callback to execute when item is clicked. |
url | string | null | External link to navigate when item is clicked. |
routerLink | array | null | RouterLink definition for internal navigation. |
routerLinkActiveOptions | object | null | Configuration for active router link. |
queryParams | object | null | Query parameters for internal navigation via routerLink. |
fragment | string | null | Sets the hash fragment for the URL. |
queryParamsHandling | QueryParamsHandling | null | How to handle query parameters in the router link for the next navigation. One of: merge : Merge new with current parameters. preserve : Preserve current parameters.k. |
preserveFragment | boolean | false | When true, preserves the URL fragment for the next navigation. |
skipLocationChange | boolean | null | When true, navigates without pushing a new state into history. |
replaceUrl | boolean | null | When true, navigates while replacing the current state in history. |
state | object | null | Developer-defined state that can be passed to any navigation. |
items | array | null | An array of children menuitems. |
expanded | boolean | false | Visibility of submenu. |
disabled | boolean | false | When set as true, disables the menuitem. |
visible | boolean | true | Whether the dom element of menuitem is created or not. |
target | string | null | Specifies where to open the linked document. |
escape | boolean | true | Whether to escape the label or not. Set to false to display html content. |
separator | boolean | false | Defines the item as a separator. |
style | object | null | Inline style of the menuitem. |
styleClass | string | null | Style class of the menuitem. |
badge | string | null | Value of the badge. |
badgeStyleClass | string | null | Style class of the badge. |
title | string | null | Tooltip text of the item. |
automationId | any | null | Value of HTML data-* attribute. |
tabindex | string | 0 | Specifies tab order of the item. |
tooltipOptions | TooltipOptions | - | Options of the item's tooltip. |