Navigation

Breadcrumb

@xui/breadcrumb

Stands in for crumbs that were dropped from the middle of a trail.

Install

pnpm add @xui/breadcrumb

Add the barrel to a standalone component's imports:

import { XuiBreadcrumbImports } from '@xui/breadcrumb';

@Component({
  imports: [XuiBreadcrumbImports],
  // …
})

Examples

Collapsing

Loading preview…

Collapse from end

Loading preview…

Custom current crumb

Source only — this one needs a component of its own to run, so there is nothing to render here.

<xui-breadcrumbs [items]="items">
  <ng-template xuiBreadcrumbsCurrent let-item>
    <span class="text-primary-emphasis inline-flex items-center gap-1.5 font-semibold">
      <ng-icon xui size="sm" name="matFolderRound" />
      {{ item.text }}
    </span>
  </ng-template>
</xui-breadcrumbs>

Composed

Loading preview…

API

XuiBreadcrumbEllipsis

componentxui-breadcrumb-ellipsis

Stands in for crumbs that were dropped from the middle of a trail.

Inputs

NameTypeDefaultclassClassValueExtra classes, merged into the component's own rather than replacing them.''

XuiBreadcrumbItem

directive[xuiBreadcrumbItem]

One crumb of the trail: the <li> holding a link (or the current page) and its separator.

Inputs

NameTypeDefaultclassClassValueExtra classes, merged into the directive's own rather than replacing them.''activebooleanEmphasise this crumb's contents. Appearance only — mark the current page with xuiBreadcrumbPage, which carries the aria-current a screen reader needs.false
directive[xuiBreadcrumbLink]

A navigable crumb.

Inputs

NameTypeDefaultclassClassValueThe user-defined classes. Merged last so they win over the base classes.''disabledbooleanRenders the crumb as unreachable without dropping it from the trail.false

XuiBreadcrumbList

directive[xuiBreadcrumbList]

The ordered list of crumbs — the layout of the trail.

Inputs

NameTypeDefaultclassClassValueExtra classes, merged into the directive's own rather than replacing them.''

XuiBreadcrumbPage

directive[xuiBreadcrumbPage]

The last crumb — where the user already is.

Inputs

NameTypeDefaultclassClassValueExtra classes, merged into the directive's own rather than replacing them.''

XuiBreadcrumbSeparator

component[xuiBreadcrumbSeparator]

The divider between two crumbs. Defaults to a chevron; project any content to replace it.

Inputs

NameTypeDefaultclassClassValueExtra classes, merged into the component's own rather than replacing them.''

XuiBreadcrumb

directive[xuiBreadcrumb]

The landmark wrapping a breadcrumb trail: a role="navigation" with an accessible name.

Inputs

NameTypeDefaultclassClassValueExtra classes, merged into the directive's own rather than replacing them.''ariaLabelstringThe landmark's accessible name. Defaults to breadcrumb; override it when a page has more than one trail, since a screen reader lists landmarks by name.'breadcrumb'

XuiBreadcrumbsItem

directiveng-template[xuiBreadcrumbsItem]

Replaces the default rendering of every crumb.

XuiBreadcrumbsCurrent

directiveng-template[xuiBreadcrumbsCurrent]

Replaces the default rendering of the current crumb only.

XuiBreadcrumbsOverflow

directiveng-template[xuiBreadcrumbsOverflow]

Replaces the ellipsis shown in place of the collapsed crumbs.

XuiBreadcrumbs

componentxui-breadcrumbs

A breadcrumb trail built from an array, collapsing to fit its container.

Inputs

NameTypeDefaultclassClassValueThe user-defined classes. Merged last so they win over the base classes.''itemsrequiredreadonly T[]The trail, root first. Each entry renders through XuiBreadcrumbData unless a xuiBreadcrumbsItem template overrides it; a wider T is passed through to that template untouched, so extra fields survive the round trip to itemClick.collapseFromXuiOverflowBoundaryWhich end collapses. A trail collapses from the start, keeping where you are.'start'minVisibleItemsnumberNever collapse below this many crumbs, however narrow the container gets.0

Outputs

NameTypeoverflowT[]Emits the collapsed crumbs whenever the set changes.itemClickTEmits when a navigable crumb is activated. A crumb with neither href nor link is not.

Source

libs/ui/breadcrumb/xui

xUI 2.0.0 — Apache 2.0 licensed. Built with Angular and Tailwind CSS.