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

API reference

Headless accordion owns section registration, expansion state normalization, and trigger focus movement. You still own the surrounding markup, copy, and styling contract.

tngAccordion

InputTypeDefaultNotes
type'single' | 'multiple''single'Controls whether one or many items can stay expanded.
valuestring | number | readonly (string | number)[] | nullundefinedControlled expansion state. undefined keeps the primitive uncontrolled.
defaultValuestring | number | readonly (string | number)[] | nullundefinedInitial uncontrolled value or values.
collapsiblebooleantrueIn single mode, allows the currently open item to collapse.
disabledbooleanfalseDisables interaction for every registered item.
loopbooleantrueLets Arrow Up and Arrow Down wrap focus between first and last enabled triggers.
lazybooleanfalsePanels do not mount until the first time they open.
keepAlivebooleantruePreviously mounted panels remain in the DOM when closed.
Host hooksdata-slot="accordion", data-type, data-disabled

The root also exposes valueChange, valuesChange, expandedChange, openStart, opened, closeStart, and closed, plus imperative open, close, toggle, and getExpandedValues() methods.

tngAccordionItem

InputTypeDefaultBehavior
valuestring | numberAuto-generatedStable identifier used in the root value set and change events.
disabledbooleanfalseOpts just this item out of pointer and keyboard interaction.
Host hooksdata-slot="accordion-item", data-state, data-disabled

tngAccordionTrigger

Reflected attrSourcePurpose
role="button"AlwaysPreserves button semantics even on non-button hosts.
tabindexAlwaysRoving focus across enabled triggers.
aria-expandedItem stateReflects whether the owning item is open.
aria-controlsOwned panel idLinks the trigger to its panel.
aria-disabled / disabledRoot or item disabled stateBlocks interaction and exposes disabled semantics.
data-state / data-disabledDerivedPrimary styling hooks for open and disabled presentation.
Keyboard behaviorEnter and Space toggle. Arrow Up, Arrow Down, Home, and End move focus.

tngAccordionPanel

Reflected attrSourcePurpose
role="region"AlwaysExposes each visible section as a labeled landmark region.
aria-labelledbyOwned trigger idConnects the panel back to its trigger text.
hiddenExpansion state + mount policyHides closed panels and unmounted lazy panels.
data-stateExpansion stateDifferentiate open versus closed visuals or transitions.
data-mountedLazy/keepAlive policyLets owners distinguish “closed but mounted” from “not mounted yet”.
Host slotdata-slot="accordion-panel"

Owner responsibilities

  • Provide real section structure and meaningful trigger text for each item.
  • Choose controlled versus uncontrolled expansion behavior for the surrounding feature.
  • Style motion, iconography, spacing, and panel content from your own CSS or utility layer.
  • Prefer native button triggers unless you explicitly need a custom focus sequence.