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

Collapsible overview

Headless collapsible is a minimal disclosure contract. It gives you a root, a trigger, and a content region with stable state hooks, while leaving state ownership, projected content, and visual treatment to your markup.

Primitive imports

ts
import {
  TngCollapsible,
  TngCollapsibleTrigger,
  TngCollapsibleContent,
} from '@tailng-ui/primitives';

Basic composition

Drive open from your own signal or input, wire the trigger to the content with contentId, and render any structure inside the content region.

Headless collapsible composition

html
<section tngCollapsible [open]="detailsOpen()">
  <button
    tngCollapsibleTrigger
    [open]="detailsOpen()"
    [contentId]="detailsContentId"
    (click)="detailsOpen.set(!detailsOpen())"
  >
    Release checklist
  </button>

  <ol
    tngCollapsibleContent
    [id]="detailsContentId"
    [open]="detailsOpen()"
    aria-label="Release checklist"
  >
    <li>Draft</li>
    <li>Review</li>
    <li>Publish</li>
  </ol>
</section>

Style variants

The same headless markup rendered through a plain CSS contract or a Tailwind utility shell.

Headless collapsible (plain CSS)

  1. Notes approved
  2. 2 QA sign-off
  3. 3 Publish

Accessibility baseline

  • The trigger stays a real button and reflects aria-expanded.
  • Provide a stable content id so aria-controls points to the owned region.
  • The content region toggles with hidden when closed.
  • Any step semantics, current-state copy, or status announcements are owner-authored.