Skip to main content
cngx-src documentation

CngxBreadcrumbIcon

Directivev0.1.0WCAG AA

projects/ui/breadcrumb/breadcrumb-icon.directive.ts

Import#

import { CngxBreadcrumbIcon } from '@cngx/ui/breadcrumb'

Description#

Structural slot for a leading per-crumb icon inside the CngxBreadcrumbBar trail. Projected once, it renders inside every crumb's link (<a>), before the label span - the counterpart to the trailing CngxBreadcrumbItemAccessory slot, which cannot lead because it renders after the link and is siblings-owned. cngx never interprets the icon: it hands the crumb's opaque CngxBreadcrumbCrumb.icon token to this template and the consumer renders it with whatever system they use - <mat-icon>, an icon font, inline SVG, or an <app-icon> component. cngx ships no icon set.

<cngx-breadcrumb [items]="crumbs" skin="iconlabel">
  <ng-template cngxBreadcrumbIcon let-crumb>
    <mat-icon aria-hidden="true">{{ crumb.icon }}</mat-icon>
  </ng-template>
</cngx-breadcrumb>

The content skins style consumer markup projected here by class: shell paints a leading root .product-mark, record a mono .rec-id; record additionally styles a .status-dot / .status-label projected through the trailing accessory slot. Those classes are the public markup contract those skins paint against.

https://cngxjs.github.io/cngx/examples/#/ui/breadcrumb/skins/iconlabel

Metadata#

Index#

Instance Properties#

templateRef#unknown
Readonly
inject<TemplateRef<CngxBreadcrumbIconContext>>(TemplateRef)

Methods#

ngTemplateContextGuard#CngxBreadcrumbIconContext
Static
ngTemplateContextGuard(_dir: CngxBreadcrumbIcon, _ctx: unknown)

Narrows let- bindings to CngxBreadcrumbIconContext under strict templates.

@param_ctxunknown