Skip to main content
cngx-src documentation

CngxAccordionItemBusy

Directivev0.1.0WCAG AA

projects/ui/accordion/accordion-item-busy.directive.ts

Import#

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

Description#

Structural slot for a CngxAccordionItem's busy state. The item renders it inside the region while the item's [state] is loading (a first-load skeleton that replaces the body) or refreshing (a subtle overlay with the body kept mounted). Absent, the item falls back to its CSS skeleton default.

The region already carries aria-busy as a computed(), so the busy visual is decorative (aria-hidden); assistive tech learns the busy state from aria-busy, not from this template. The template receives a CngxAccordionItemStateContext whose $implicit is the current status (loading / refreshing), so one override can distinguish the two.

<cngx-accordion-item [state]="report.status()">
  <span cngxAccordionItemTitle>Report</span>
  <ng-template cngxAccordionItemBusy let-status><my-skeleton [dim]="status === 'refreshing'" /></ng-template>
  <ng-template cngxAccordionItemContent>{{ report.data() }}</ng-template>
</cngx-accordion-item>

Metadata#

Dependencies#

TemplateRefinject()templateRef

Index#

Methods#

ngTemplateContextGuard#CngxAccordionItemStateContext
Static
ngTemplateContextGuard(_dir: CngxAccordionItemBusy, ctx: unknown)
@paramctxunknown