Skip to main content
cngx-src documentation

createTabGroupTemplateBindings

Functioncommon/tabs/slotsv0.1.0WCAG AA

projects/common/tabs/slots/tab-group-template-cascade.ts

Description#

Wires the 3-stage template cascade for the <cngx-tab-group> skin slots (errorBadge / rejectionIcon / busySpinner / icon / closeIcon / addIcon): per-instance directive > CNGX_TABS_CONFIG.templates.<key> > null.

null means the organism renders its built-in default - a default span for the state decorations, the CNGX_TABS_GLYPHS glyph for closeIcon / addIcon, and nothing for icon.

Pure — no DI, no side effects. Safe in field-init. Sibling to createStepperTemplateBindings and createTabOverflowTemplateBindings.

Single-consumer today: [cngxMatTabs] does not consume this — Material owns the rendered tab-button chrome via its own MDC template, leaving no DOM seam. See tabs-accepted-debt §9.

UX / a11y

  • The cascade is presentation-only; the accessibility contract is invariant under it. Overriding a slot never strips its accessible default (fallthrough to a built-in or the organism default).
  • The screen-reader channel (descriptor / aria-busy / live region) lives on the organism, not the slot template, so swapping a decoration template changes only the visual.
  • An unbound icon slot resolves to nothing, which is correct - the icon is decorative and the label carries the accessible name.

Signature#

createTabGroupTemplateBindings(opts: CngxTabGroupTemplateBindingsOptions)

Parameters#

Returns#

CngxTabGroupTemplateBindings