Getting StartedInstall and bootstrap headless foundations 4
LayoutHeadless structural primitives for expandable and container patterns 6
OverlayHeadless modal and floating layer behavior 3
FeedbackHeadless notification and status communication patterns 5
FormHeadless input and selection contracts 17
UtilityReusable action, identity, and clipboard behavior 6
NavigationHeadless trails, trees, menus, and command surfaces 7

Accordion overview

Headless accordion gives you section registration, roving trigger focus, and panel visibility semantics without prescribing markup beyond the root, item, trigger, and panel directives.

Primitive imports

ts
import {
  TngAccordion,
  TngAccordionItem,
  TngAccordionTrigger,
  TngAccordionPanel,
} from '@tailng-ui/primitives';

Basic composition

Attach tngAccordion to a group root, register each section with tngAccordionItem, and let the trigger and panel coordinate ids and ARIA wiring.

Headless accordion composition

html
<section tngAccordion aria-label="Workspace FAQ" [defaultValue]="'ownership'">
  <article tngAccordionItem value="ownership">
    <button tngAccordionTrigger type="button">Ownership model</button>
    <div tngAccordionPanel>
      Copy-paste mode keeps wrapper source in your app for long-term ownership.
    </div>
  </article>

  <article tngAccordionItem value="testing">
    <button tngAccordionTrigger type="button">Testing strategy</button>
    <div tngAccordionPanel>
      Primitive suites cover keyboard, pointer, and ARIA behavior.
    </div>
  </article>
</section>

Style variants

The same headless primitive contract rendered through a local CSS shell or a Tailwind utility shell.

Headless accordion (plain CSS)

Copy-paste mode keeps source in your app for long-term ownership.

Accessibility baseline

  • Triggers reflect aria-expanded, aria-controls, and roving tabindex.
  • Panels render as role="region" and point back to the owning trigger with aria-labelledby.
  • Arrow Up, Arrow Down, Home, and End move across enabled triggers.
  • Use native button triggers when possible so tab order stays natural.