CngxBreadcrumbBar
projects/ui/breadcrumb/breadcrumb-bar.component.ts
Import#
import { CngxBreadcrumbBar } from '@cngx/ui/breadcrumb'
Description#
Breadcrumb bar organism. A thin <cngx-breadcrumb [items]="..."> shell that
renders a trail through the headless @cngx/common/interactive trio
(CngxBreadcrumb / CngxBreadcrumbItem / CngxBreadcrumbSeparator) - the
bar forwards inputs and owns the skin, the trio owns the collapse, terminal
marking, and landmark a11y. Everything derives (Pillar 1); nothing here syncs.
Two data modes without baking @angular/router into the base component:
the uncontrolled [items] input, and an opt-in controlled source provided
through CNGX_BREADCRUMB_ITEMS_SOURCE (the router-sync directive). The
source wins over the input via computed, so an external producer augments
the trail through a token, never by writing this component's input().
<cngx-breadcrumb [items]="crumbs" [maxVisible]="4" skin="pill" />Metadata#
Host#
Relationships
Index#
Properties
Derived State
HostBindings
Inputs#
readonly CngxBreadcrumbCrumb[]Uncontrolled trail. Ignored when a CNGX_BREADCRUMB_ITEMS_SOURCE is provided.
[], { alias: 'items' }Accessible name of the nav landmark. Falls back through the config cascade to the EN default.
this.cfg.ariaLabels?.bar ?? 'Breadcrumb'number | undefinedMaximum crumbs to show before the middle collapses. Unset = never collapse, unless responsive is on. An explicit value always wins over the width-derived one (controlled/uncontrolled), resolved by effectiveMaxVisible.
Opt in to width-responsive collapse: the bar derives maxVisible from its own
width via the CngxResizeObserver hostDirective and the pure
resolveBreadcrumbTier. No hand-wired observer or computed needed - one
attribute makes every skin responsive. Ignored when maxVisible is set.
false, { transform: booleanAttribute }readonly CngxBreadcrumbWidthTier[]Width tiers driving the responsive collapse. Defaults to DEFAULT_BREADCRUMB_WIDTH_TIERS.
DEFAULT_BREADCRUMB_WIDTH_TIERSVisual skin, reflected onto [data-skin]. Cascade input ?? config.skin ?? 'classic', resolved by resolvedSkin. Pure thematic concern -
structure, slots, and ARIA are identical across values.
Instance Properties#
unknownProjected per-crumb accessory template. When present it wins over the
declarative crumb.siblings auto-render for every crumb (one predictable
owner of the accessory area). The contentChild is already a
Signal<TemplateRef | undefined> - bound directly, no pass-through computed.
contentChild(CngxBreadcrumbItemAccessory, { read: TemplateRef })unknownProjected leading per-crumb icon template. Rendered inside every crumb link
(<a>) before the label span, fed the { crumb, index } context so the
consumer renders the opaque crumb.icon with any icon system. Direct
Signal<TemplateRef | undefined> - bound in the template, no pass-through.
contentChild(CngxBreadcrumbIcon, { read: TemplateRef })unknownThe rendered trail: a provided source wins over the [items] input (controlled/uncontrolled).
createControlledSource(this.itemsSource?.crumbs, this.itemsInput)unknownProjected overflow-row template, forwarded to the composed
CngxBreadcrumbOverflow (which the consumer cannot reach as
contentChild through the bar). Lets a consumer customize the collapsed-crumb
rows without hand-composing the headless trail.
contentChild(CngxBreadcrumbOverflowItem, { read: TemplateRef })HostBindings#
| Binding | Expression |
|---|---|
[attr.data-skin] | resolvedSkin() |
Index#
Theming
*noneLink text-decoration under the plain skin (retints the shared link-decoration leaf token). @group Skin
*0.375rem 0.75remInline padding of the contained list surface. @group Skin
<color>#f4f4f5Surface fill of the contained list box (set adaptively from --cngx-color-surface in :scope). @group Skin
*1px solidBorder width + style of the contained box. @group Skin
<color>#e4e4e7Border colour of the contained box (set adaptively from --cngx-color-border in :scope). @group Skin
*0.375remCorner radius of the contained box. @group Skin
<color>oklch(0.97 0.005 250)Track fill of the segmented pill bar. @group Skin
<color>oklch(0.88 0.005 250)Track border of the segmented pill bar. @group Skin
*999pxCorner radius of the pill track and its segments. @group Skin
<color>oklch(0.5 0.01 250)Resting segment label colour under the pill skin. @group Skin
<color>oklch(0.95 0.03 50)Hover segment fill under the pill skin. @group Skin
<color>oklch(0.2 0.01 250)Hover segment label colour under the pill skin. @group Skin
<color>oklch(0.66 0.19 50)Active-segment fill under the pill skin. @group Skin
<color>oklch(1 0 0)Active-segment label colour under the pill skin. @group Skin
*0.875remSegment font size under the pill skin. @group Skin
<color>oklch(0.97 0.005 250)<color>oklch(0.5 0.01 250)<color>oklch(0.95 0.03 50)<color>oklch(0.2 0.01 250)<color>oklch(0.66 0.19 50)<color>oklch(1 0 0)*0.875rem*4px<color>oklch(0.66 0.19 50)<color>oklch(0.2 0.01 250)*1rem<color>oklch(0.5 0.01 250)<color>oklch(0.97 0.005 250)<color>oklch(0.2 0.01 250)*0.875rem*1.125rem*4px<color>oklch(0.66 0.19 50)<color>oklch(1 0 0)<color>oklch(0.95 0.03 50)<color>oklch(0.5 0.01 250)<color>oklch(0.2 0.01 250)<color>oklch(0.8 0.06 50)*0.875rem<color>oklch(1 0 0)<color>oklch(0.78 0.01 250)<color>oklch(0.88 0.005 250)<color>oklch(0.5 0.01 250)<color>oklch(0.97 0.005 250)<color>oklch(0.2 0.01 250)<color>oklch(0.95 0.03 50)<color>oklch(0.66 0.19 50)*0.875rem*4px<color>oklch(1 0 0)<color>oklch(0.88 0.005 250)<color>oklch(0.5 0.01 250)<color>oklch(0.78 0.01 250)<color>oklch(0.97 0.005 250)<color>oklch(0.2 0.01 250)<color>oklch(0.95 0.03 50)<color>oklch(0.82 0.08 50)<color>oklch(0.66 0.19 50)*0.875rem*999px<color>oklch(0.97 0.005 250)<color>oklch(0.88 0.005 250)<color>oklch(0.5 0.01 250)<color>oklch(1 0 0)<color>oklch(0.2 0.01 250)<color>oklch(0.66 0.19 50)<color>oklch(0.72 0.01 250)*8px*4px*0.875rem<color>oklch(0.5 0.01 250)<color>oklch(0.97 0.005 250)<color>oklch(0.2 0.01 250)<color>oklch(0.95 0.03 50)<color>oklch(0.66 0.19 50)*999px*0.875rem<color>oklch(0.5 0.01 250)<color>oklch(0.97 0.005 250)<color>oklch(0.2 0.01 250)<color>oklch(0.66 0.19 50)<color>oklch(1 0 0)<color>oklch(0.2 0.01 250)<color>oklch(1 0 0)*4px*0.875rem<color>oklch(0.5 0.01 250)<color>oklch(0.97 0.005 250)<color>oklch(0.2 0.01 250)<color>oklch(0.66 0.19 50)<color>oklch(1 0 0)*0.875rem*4px<color>oklch(0.5 0.01 250)<color>oklch(0.97 0.005 250)<color>oklch(0.2 0.01 250)<color>oklch(1 0 0)<color>oklch(0.78 0.01 250)<color>oklch(0.7 0.17 145)*0.875rem*4px*999px