VanillaReactLight & dark1.2K views
Single-mode ARIA accordion styled as a code editor — a faq.json tab with line-number gutter, code-fold carets, JSON syntax highlighting, and a VS Code style status bar. Opening one folded region closes the others, with grid-row height animation and full keyboard navigation, fully token-driven.
Get the code for free
Create a free account to copy or download the full source.
Accordion component
Single-mode ARIA accordion styled as a code editor — a faq.json tab with line-number gutter, code-fold carets, JSON syntax highlighting, and a VS Code style status bar. Opening one folded region closes the others, with grid-row height animation and full keyboard navigation, fully token-driven.
<button> is the sole child of an <h2>, with aria-expanded, aria-controls, and a labelled panel hidden from assistive technology when collapseddata-mode: single closes siblings, multi toggles independentlygrid-template-rows 0fr to 1fr trick⋯ badge and closing bracefaq.json tab, mono line-number gutter with divider, JSON syntax palette (key, string, comment, punctuation), blinking caret, azure status bar<button> is the sole child of an <h2> and controls a labelled role="region" panelaria-hidden and inert apply immediately; hidden applies after the closing transition and is cancelled on reopenArrowUp/ArrowDown move focus, Home/End jump, Enter/Space toggle:focus-visible with --ring outline on all elementsOpen Accordion — Single Mode in Atheros AI Builder, pick a design system and ask the AI assistant to change the layout, copy or behaviour — the accordion is regenerated against your tokens. Take the HTML, CSS, JS and React source with you, or pull it into your repo from Claude Code, Cursor or Codex over MCP.
Starting at $9.9 per month, billed annually
Don't miss a beat with our newsletter!
BUILDER
ABOUT US
© 2026 Atheros Intelligence Ltd.
aria-hiddenaria-label with the plain question textprefers-reduced-motion: reduce disables all animations100dvh for mobile-safe viewport height