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)
- ✓ Notes approved
- 2 QA sign-off
- 3 Publish
Headless collapsible (Tailwind CSS)
- ✓ Build approved
- 2 Traffic ramp
- 3 Post-release review
Accessibility baseline
- The trigger stays a real
buttonand reflectsaria-expanded. - Provide a stable content id so
aria-controlspoints to the owned region. - The content region toggles with
hiddenwhen closed. - Any step semantics, current-state copy, or status announcements are owner-authored.