Cookbook / Accordion

Accordion

container

Accordion — each/key over prop-provided items, show toggles the open panel, aria-expanded tracks state.

id
aihu-accordion
since
0.5.0
file
aihu-accordion.aihu
propstateactioneachkeyshowgroupon:clickinterpolation

Run it

source · static

This recipe doesn't have a hydrated island in the demo gallery yet. An in-browser, WASM-compiled playground (edit this source and re-render live) is planned as a follow-up — read the real source below.

Source

aihu-accordion.aihu

Requires

concerns
statea11y

Anti-patterns

  • Do not drive frequently-toggled panels with if= — show keeps DOM and internal state alive; if= tears down and rebuilds.

Related recipes