Skip to main content
cngx-src documentation

withAccordionLabels

Functionui/accordionv0.1.0

projects/ui/accordion/config/features.ts

Description#

Override the accordion's locale-sensitive announced strings - disabledReason (spoken when an item is disabled) and errorMessage (spoken via role="alert" when an item's [state] is error and no error slot is given). Pass either or both. Per-instance [disabledReason] / [errorMessage] still win over the cascade; this only sets the fallback.

provideAccordionConfig(
  withAccordionLabels({
    disabledReason: 'This section is locked.',
    errorMessage: 'This section failed to load.',
  }),
);

Signature#

withAccordionLabels(payload)

Parameters#

@parampayload

Returns#

CngxAccordionConfigFeature