Skip to main content

Breadcrumb

shadow

Breadcrumb displays one segment of the navigation path in the application and is a descendant of the Breadcrumbs element. It can also display an icon.

Note

For more information on using Breadcrumbs, navigate to the Breadcrumbs element documentation.

When to use

Use wje-breadcrumb when users need to understand location, move between views, or traverse hierarchy.

When not to use

Do not combine multiple competing navigation patterns for the same user flow.

Accessibility

Ensure visible active/selected states, predictable tab order, and clear control naming.

Best Practices

  • Keep URL state and UI navigation state synchronized.
  • Use consistent labels across menu, breadcrumbs, and tabs.
  • Add context for deep structures (breadcrumbs, headings, icon cues).

Attributes and Properties

showCollapsedIndicator

DescriptionControls how show-collapsed-indicator behaves in the component.
Attributeshow-collapsed-indicator
Typeany
Default-

collapsed

DescriptionControls whether the component is collapsed.
Attributecollapsed
Typeany
Default-

last

DescriptionControls how last behaves in the component.
Attributelast
Typeany
Default-

Events

No events available for this component.

Methods

drawCollapsedIndicator

DescriptionRenders the collapsed indicator based on the current collapsed variant. If the collapsed variant is 'DROPDOWN', it invokes the collapseDropdown method. Otherwise, it invokes the collapseButton method.
Signature() => any

collapseDropdown

DescriptionCreates and returns a dropdown UI component for collapsed breadcrumbs. This method generates a dropdown element with a button trigger and a menu populated with items corresponding to the collapsed breadcrumbs. The dropdown is configured to handle specific interactions and ensure that events are appropriately managed to avoid propagation issues. Menu items are linked to their corresponding breadcrumbs, enabling the same functionality as clicking on the original breadcrumb.
Signature() => HTMLElement

collapseButton

DescriptionCreates a button element that expands hidden breadcrumbs when clicked. The button is set with appropriate attributes and event listeners to handle the expanding of hidden breadcrumb elements. Clicking the button will remove the button itself, reveal hidden breadcrumbs, and stop the current event propagation.
Signature() => HTMLButtonElement

getBreadcrumbs

DescriptionRetrieves the breadcrumb trail for the current element by returning its parent element.
Signature() => Element

CSS Shadow Parts

NameDescription
nativeThe native wrapper of the breadcrumb component.
separatorThe separator between breadcrumb items.

CSS Custom Properties

NameDescription
--wje-breadcrumb-aThe color of the breadcrumb text.
--wje-breadcrumb-a-hoverThe color of the breadcrumb separator line.

Slots

NameDescription
defaultThe main content of the breadcrumb.
startSlot for content at the start of the breadcrumb.
endSlot for content at the end of the breadcrumb.
separatorSlot for a custom separator between breadcrumb items.