Skip to main content
cngx-src documentation

CngxAccordionConfig

Interface

projects/ui/accordion/config/accordion.config.ts

Import#

import { CngxAccordionConfig } from '@cngx/ui/accordion'

Description#

App-wide cascade for the accordion organism's locale-sensitive disabledReason string, the default heading level, and app-wide slot templates.

Resolution priority (high -> low):

  1. Per-instance Input binding ([disabledReason] / [headingLevel]).
  2. provideAccordionConfigAt(...) in a parent component's viewProviders (component-scoped override).
  3. provideAccordionConfig(...) at the application root.
  4. Library defaults (English; CNGX_ACCORDION_DEFAULTS).

Both keys are required on the resolved config - the token ships a complete default, and every with* feature overrides a whole key, so no consumer ever observes a partial shape.

Index#

Instance Properties#

disabledReason#string
Readonly

Reason announced to assistive tech when an item is disabled, bound through the item's always-present aria-describedby reason element. English default; a per-instance [disabledReason] still wins over the cascade.

errorMessage#string
Readonly

Message announced (via a role="alert") when an item's [state] is error and no *cngxAccordionItemError slot is provided. English default; a per-instance [errorMessage] or the error slot still wins. Ships a spoken default so the error state is never silent to assistive tech (Pillar 2).

headingLevel#number
Readonly

Default aria-level (2-6) every CngxAccordionGroup heading wrapper reflects when [headingLevel] is not bound. Clamped into the ARIA range by the group.

ReadonlyOptional

App-wide default visual skin reflected onto [data-skin]. Unset by default (the base flat look). A per-instance [skin] Input still wins; this only moves the cascade default. Override via withAccordionSkin.

templates#literal type
ReadonlyOptional

App-wide slot templates - the third tier of the slot cascade (*cngxAccordionItemXxx per-instance -> this -> CSS default). Only slots with a plausible app-wide default carry a config tier: the chevron, the busy spinner, and the error affordance all have a design-system default; title and body are per-item content with no meaningful app-wide default, so they get no config tier.