Skip to main content
cngx-src documentation

CngxBreadcrumbBar

ComponentPrimaryOnPushNo encapsulationv0.1.0WCAG AA

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" />

https://cngxjs.github.io/cngx/examples/#/ui/breadcrumb/basic/explicit-items

Metadata#

Host#

Relationships

Index#

Inputs#

input()

Uncontrolled trail. Ignored when a CNGX_BREADCRUMB_ITEMS_SOURCE is provided.

default [], { alias: 'items' }
label#string
input()

Accessible name of the nav landmark. Falls back through the config cascade to the EN default.

default this.cfg.ariaLabels?.bar ?? 'Breadcrumb'
maxVisible#number | undefined
input()

Maximum 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.

responsive#
input()

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.

default false, { transform: booleanAttribute }
input()

Width tiers driving the responsive collapse. Defaults to DEFAULT_BREADCRUMB_WIDTH_TIERS.

default DEFAULT_BREADCRUMB_WIDTH_TIERS
input()

Visual 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#

accessory#unknown
contentChild()ProtectedReadonly

Projected 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 })
icon#unknown
contentChild()ProtectedReadonly

Projected 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 })
items#unknown
ProtectedReadonly

The rendered trail: a provided source wins over the [items] input (controlled/uncontrolled).

createControlledSource(this.itemsSource?.crumbs, this.itemsInput)
overflowRow#unknown
contentChild()ProtectedReadonly

Projected 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#

BindingExpression
[attr.data-skin]resolvedSkin()

Index#

Theming

--cngx-breadcrumb-plain-link-decoration--cngx-breadcrumb-contained-padding--cngx-breadcrumb-contained-bg--cngx-breadcrumb-contained-border--cngx-breadcrumb-contained-border-color--cngx-breadcrumb-contained-radius--cngx-breadcrumb-pill-track-bg--cngx-breadcrumb-pill-track-border--cngx-breadcrumb-pill-radius--cngx-breadcrumb-pill-color--cngx-breadcrumb-pill-hover-bg--cngx-breadcrumb-pill-hover-color--cngx-breadcrumb-pill-active-bg--cngx-breadcrumb-pill-active-color--cngx-breadcrumb-pill-font-size--cngx-breadcrumb-ribbon-bg--cngx-breadcrumb-ribbon-color--cngx-breadcrumb-ribbon-hover-bg--cngx-breadcrumb-ribbon-hover-color--cngx-breadcrumb-ribbon-active-bg--cngx-breadcrumb-ribbon-active-color--cngx-breadcrumb-ribbon-font-size--cngx-breadcrumb-ribbon-radius--cngx-breadcrumb-editorial-accent--cngx-breadcrumb-editorial-text--cngx-breadcrumb-editorial-font-size--cngx-breadcrumb-header-color--cngx-breadcrumb-header-hover-bg--cngx-breadcrumb-header-text--cngx-breadcrumb-header-font-size--cngx-breadcrumb-header-leaf-font-size--cngx-breadcrumb-header-radius--cngx-breadcrumb-metro-accent--cngx-breadcrumb-metro-surface--cngx-breadcrumb-metro-hover-dot--cngx-breadcrumb-metro-color--cngx-breadcrumb-metro-active-color--cngx-breadcrumb-metro-rail--cngx-breadcrumb-metro-font-size--cngx-breadcrumb-toolbar-bg--cngx-breadcrumb-toolbar-border-strong--cngx-breadcrumb-toolbar-cell-border--cngx-breadcrumb-toolbar-color--cngx-breadcrumb-toolbar-hover-bg--cngx-breadcrumb-toolbar-hover-color--cngx-breadcrumb-toolbar-active-bg--cngx-breadcrumb-toolbar-active-color--cngx-breadcrumb-toolbar-font-size--cngx-breadcrumb-toolbar-radius--cngx-breadcrumb-chips-bg--cngx-breadcrumb-chips-border--cngx-breadcrumb-chips-color--cngx-breadcrumb-chips-hover-border--cngx-breadcrumb-chips-hover-bg--cngx-breadcrumb-chips-hover-color--cngx-breadcrumb-chips-active-bg--cngx-breadcrumb-chips-active-border--cngx-breadcrumb-chips-active-color--cngx-breadcrumb-chips-font-size--cngx-breadcrumb-chips-radius--cngx-breadcrumb-path-track-bg--cngx-breadcrumb-path-track-border--cngx-breadcrumb-path-color--cngx-breadcrumb-path-hover-bg--cngx-breadcrumb-path-hover-color--cngx-breadcrumb-path-active-color--cngx-breadcrumb-path-sep-color--cngx-breadcrumb-path-radius--cngx-breadcrumb-path-link-radius--cngx-breadcrumb-path-font-size--cngx-breadcrumb-iconlabel-color--cngx-breadcrumb-iconlabel-hover-bg--cngx-breadcrumb-iconlabel-hover-color--cngx-breadcrumb-iconlabel-active-bg--cngx-breadcrumb-iconlabel-active-color--cngx-breadcrumb-iconlabel-radius--cngx-breadcrumb-iconlabel-font-size--cngx-breadcrumb-icononly-color--cngx-breadcrumb-icononly-hover-bg--cngx-breadcrumb-icononly-hover-color--cngx-breadcrumb-icononly-active-bg--cngx-breadcrumb-icononly-active-color--cngx-breadcrumb-icononly-tip-bg--cngx-breadcrumb-icononly-tip-color--cngx-breadcrumb-icononly-radius--cngx-breadcrumb-icononly-font-size--cngx-breadcrumb-shell-color--cngx-breadcrumb-shell-hover-bg--cngx-breadcrumb-shell-text--cngx-breadcrumb-shell-mark-bg--cngx-breadcrumb-shell-mark-color--cngx-breadcrumb-shell-font-size--cngx-breadcrumb-shell-radius--cngx-breadcrumb-record-color--cngx-breadcrumb-record-hover-bg--cngx-breadcrumb-record-text--cngx-breadcrumb-record-chip-bg--cngx-breadcrumb-record-chip-border--cngx-breadcrumb-record-status--cngx-breadcrumb-record-font-size--cngx-breadcrumb-record-radius--cngx-breadcrumb-record-chip-radius
--cngx-breadcrumb-contained-padding#*
Default value 0.375rem 0.75rem

Inline padding of the contained list surface. @group Skin

--cngx-breadcrumb-contained-bg#<color>
Default value #f4f4f5

Surface fill of the contained list box (set adaptively from --cngx-color-surface in :scope). @group Skin

--cngx-breadcrumb-contained-border#*
Default value 1px solid

Border width + style of the contained box. @group Skin

--cngx-breadcrumb-contained-border-color#<color>
Default value #e4e4e7

Border colour of the contained box (set adaptively from --cngx-color-border in :scope). @group Skin

--cngx-breadcrumb-contained-radius#*
Default value 0.375rem

Corner radius of the contained box. @group Skin

--cngx-breadcrumb-pill-track-bg#<color>
Default value oklch(0.97 0.005 250)

Track fill of the segmented pill bar. @group Skin

--cngx-breadcrumb-pill-track-border#<color>
Default value oklch(0.88 0.005 250)

Track border of the segmented pill bar. @group Skin

--cngx-breadcrumb-pill-radius#*
Default value 999px

Corner radius of the pill track and its segments. @group Skin

--cngx-breadcrumb-pill-color#<color>
Default value oklch(0.5 0.01 250)

Resting segment label colour under the pill skin. @group Skin

--cngx-breadcrumb-pill-hover-bg#<color>
Default value oklch(0.95 0.03 50)

Hover segment fill under the pill skin. @group Skin

--cngx-breadcrumb-pill-hover-color#<color>
Default value oklch(0.2 0.01 250)

Hover segment label colour under the pill skin. @group Skin

--cngx-breadcrumb-pill-active-bg#<color>
Default value oklch(0.66 0.19 50)

Active-segment fill under the pill skin. @group Skin

--cngx-breadcrumb-pill-active-color#<color>
Default value oklch(1 0 0)

Active-segment label colour under the pill skin. @group Skin

--cngx-breadcrumb-pill-font-size#*
Default value 0.875rem

Segment font size under the pill skin. @group Skin

--cngx-breadcrumb-ribbon-bg#<color>
Default value oklch(0.97 0.005 250)
--cngx-breadcrumb-ribbon-color#<color>
Default value oklch(0.5 0.01 250)
--cngx-breadcrumb-ribbon-hover-bg#<color>
Default value oklch(0.95 0.03 50)
--cngx-breadcrumb-ribbon-hover-color#<color>
Default value oklch(0.2 0.01 250)
--cngx-breadcrumb-ribbon-active-bg#<color>
Default value oklch(0.66 0.19 50)
--cngx-breadcrumb-ribbon-active-color#<color>
Default value oklch(1 0 0)
--cngx-breadcrumb-ribbon-font-size#*
Default value 0.875rem
--cngx-breadcrumb-ribbon-radius#*
Default value 4px
--cngx-breadcrumb-editorial-accent#<color>
Default value oklch(0.66 0.19 50)
--cngx-breadcrumb-editorial-text#<color>
Default value oklch(0.2 0.01 250)
--cngx-breadcrumb-editorial-font-size#*
Default value 1rem
--cngx-breadcrumb-header-color#<color>
Default value oklch(0.5 0.01 250)
--cngx-breadcrumb-header-hover-bg#<color>
Default value oklch(0.97 0.005 250)
--cngx-breadcrumb-header-text#<color>
Default value oklch(0.2 0.01 250)
--cngx-breadcrumb-header-font-size#*
Default value 0.875rem
--cngx-breadcrumb-header-leaf-font-size#*
Default value 1.125rem
--cngx-breadcrumb-header-radius#*
Default value 4px
--cngx-breadcrumb-metro-accent#<color>
Default value oklch(0.66 0.19 50)
--cngx-breadcrumb-metro-surface#<color>
Default value oklch(1 0 0)
--cngx-breadcrumb-metro-hover-dot#<color>
Default value oklch(0.95 0.03 50)
--cngx-breadcrumb-metro-color#<color>
Default value oklch(0.5 0.01 250)
--cngx-breadcrumb-metro-active-color#<color>
Default value oklch(0.2 0.01 250)
--cngx-breadcrumb-metro-rail#<color>
Default value oklch(0.8 0.06 50)
--cngx-breadcrumb-metro-font-size#*
Default value 0.875rem
--cngx-breadcrumb-toolbar-bg#<color>
Default value oklch(1 0 0)
--cngx-breadcrumb-toolbar-border-strong#<color>
Default value oklch(0.78 0.01 250)
--cngx-breadcrumb-toolbar-cell-border#<color>
Default value oklch(0.88 0.005 250)
--cngx-breadcrumb-toolbar-color#<color>
Default value oklch(0.5 0.01 250)
--cngx-breadcrumb-toolbar-hover-bg#<color>
Default value oklch(0.97 0.005 250)
--cngx-breadcrumb-toolbar-hover-color#<color>
Default value oklch(0.2 0.01 250)
--cngx-breadcrumb-toolbar-active-bg#<color>
Default value oklch(0.95 0.03 50)
--cngx-breadcrumb-toolbar-active-color#<color>
Default value oklch(0.66 0.19 50)
--cngx-breadcrumb-toolbar-font-size#*
Default value 0.875rem
--cngx-breadcrumb-toolbar-radius#*
Default value 4px
--cngx-breadcrumb-chips-bg#<color>
Default value oklch(1 0 0)
--cngx-breadcrumb-chips-border#<color>
Default value oklch(0.88 0.005 250)
--cngx-breadcrumb-chips-color#<color>
Default value oklch(0.5 0.01 250)
--cngx-breadcrumb-chips-hover-border#<color>
Default value oklch(0.78 0.01 250)
--cngx-breadcrumb-chips-hover-bg#<color>
Default value oklch(0.97 0.005 250)
--cngx-breadcrumb-chips-hover-color#<color>
Default value oklch(0.2 0.01 250)
--cngx-breadcrumb-chips-active-bg#<color>
Default value oklch(0.95 0.03 50)
--cngx-breadcrumb-chips-active-border#<color>
Default value oklch(0.82 0.08 50)
--cngx-breadcrumb-chips-active-color#<color>
Default value oklch(0.66 0.19 50)
--cngx-breadcrumb-chips-font-size#*
Default value 0.875rem
--cngx-breadcrumb-chips-radius#*
Default value 999px
--cngx-breadcrumb-path-track-bg#<color>
Default value oklch(0.97 0.005 250)
--cngx-breadcrumb-path-track-border#<color>
Default value oklch(0.88 0.005 250)
--cngx-breadcrumb-path-color#<color>
Default value oklch(0.5 0.01 250)
--cngx-breadcrumb-path-hover-bg#<color>
Default value oklch(1 0 0)
--cngx-breadcrumb-path-hover-color#<color>
Default value oklch(0.2 0.01 250)
--cngx-breadcrumb-path-active-color#<color>
Default value oklch(0.66 0.19 50)
--cngx-breadcrumb-path-sep-color#<color>
Default value oklch(0.72 0.01 250)
--cngx-breadcrumb-path-radius#*
Default value 8px
--cngx-breadcrumb-path-font-size#*
Default value 0.875rem
--cngx-breadcrumb-iconlabel-color#<color>
Default value oklch(0.5 0.01 250)
--cngx-breadcrumb-iconlabel-hover-bg#<color>
Default value oklch(0.97 0.005 250)
--cngx-breadcrumb-iconlabel-hover-color#<color>
Default value oklch(0.2 0.01 250)
--cngx-breadcrumb-iconlabel-active-bg#<color>
Default value oklch(0.95 0.03 50)
--cngx-breadcrumb-iconlabel-active-color#<color>
Default value oklch(0.66 0.19 50)
--cngx-breadcrumb-iconlabel-radius#*
Default value 999px
--cngx-breadcrumb-iconlabel-font-size#*
Default value 0.875rem
--cngx-breadcrumb-icononly-color#<color>
Default value oklch(0.5 0.01 250)
--cngx-breadcrumb-icononly-hover-bg#<color>
Default value oklch(0.97 0.005 250)
--cngx-breadcrumb-icononly-hover-color#<color>
Default value oklch(0.2 0.01 250)
--cngx-breadcrumb-icononly-active-bg#<color>
Default value oklch(0.66 0.19 50)
--cngx-breadcrumb-icononly-active-color#<color>
Default value oklch(1 0 0)
--cngx-breadcrumb-icononly-tip-bg#<color>
Default value oklch(0.2 0.01 250)
--cngx-breadcrumb-icononly-tip-color#<color>
Default value oklch(1 0 0)
--cngx-breadcrumb-icononly-radius#*
Default value 4px
--cngx-breadcrumb-icononly-font-size#*
Default value 0.875rem
--cngx-breadcrumb-shell-color#<color>
Default value oklch(0.5 0.01 250)
--cngx-breadcrumb-shell-hover-bg#<color>
Default value oklch(0.97 0.005 250)
--cngx-breadcrumb-shell-text#<color>
Default value oklch(0.2 0.01 250)
--cngx-breadcrumb-shell-mark-bg#<color>
Default value oklch(0.66 0.19 50)
--cngx-breadcrumb-shell-mark-color#<color>
Default value oklch(1 0 0)
--cngx-breadcrumb-shell-font-size#*
Default value 0.875rem
--cngx-breadcrumb-shell-radius#*
Default value 4px
--cngx-breadcrumb-record-color#<color>
Default value oklch(0.5 0.01 250)
--cngx-breadcrumb-record-hover-bg#<color>
Default value oklch(0.97 0.005 250)
--cngx-breadcrumb-record-text#<color>
Default value oklch(0.2 0.01 250)
--cngx-breadcrumb-record-chip-bg#<color>
Default value oklch(1 0 0)
--cngx-breadcrumb-record-chip-border#<color>
Default value oklch(0.78 0.01 250)
--cngx-breadcrumb-record-status#<color>
Default value oklch(0.7 0.17 145)
--cngx-breadcrumb-record-font-size#*
Default value 0.875rem
--cngx-breadcrumb-record-radius#*
Default value 4px
--cngx-breadcrumb-record-chip-radius#*
Default value 999px