# Accordion — Single Mode

> 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.

- Category: Accordion
- Frameworks: Vanilla, React + CSS, React + Tailwind
- Design system: Sienna
- Dark mode: yes
- Access: premium (Atheros AI Pass)
- Tags: faq, disclosure, data-display
- Page: https://builder.atheros.ai/components/accordion-single-mode
- Preview: https://d17nmjscumqk5d.cloudfront.net/builder/templates/tpl_019/preview-c344aa67aab2.webp

## Features

- APG disclosure pattern: each `<button>` is the sole child of an `<h2>`, with `aria-expanded`, `aria-controls`, and a labelled panel hidden from assistive technology when collapsed
- Two expand modes via `data-mode`: `single` closes siblings, `multi` toggles independently
- Layout-safe height animation using the CSS `grid-template-rows` 0fr to 1fr trick
- Code-fold interaction: a chevron caret rotates 90 degrees on expand, collapsed rows hint the folded body with a bordered `⋯` badge and closing brace
- Code-editor identity: title bar with window dots and breadcrumb, active `faq.json` tab, mono line-number gutter with divider, JSON syntax palette (key, string, comment, punctuation), blinking caret, azure status bar
- Editor line-highlight on hover and a region tint plus gutter rail on the open item
- Keyboard navigation: Up/Down between headers, Home/End to jump, Enter/Space to toggle
- Responsive layout down to 320px with prefers-reduced-motion support

## Accessibility

- **Disclosure pattern** — Each header `<button>` is the sole child of an `<h2>` and controls a labelled `role="region"` panel
- **Collapsed panels** — `aria-hidden` and `inert` apply immediately; `hidden` applies after the closing transition and is cancelled on reopen
- **Keyboard nav** — `ArrowUp`/`ArrowDown` move focus, `Home`/`End` jump, `Enter`/`Space` toggle
- **Focus indicators** — `:focus-visible` with `--ring` outline on all elements
- **Decorative chrome** — Title bar, comment line, status bar, fold hints, and caret are `aria-hidden`
- **Accessible names** — Header buttons carry `aria-label` with the plain question text
- **Reduced motion** — `prefers-reduced-motion: reduce` disables all animations
- **Viewport** — `100dvh` for mobile-safe viewport height

## Keyboard shortcuts

- `ArrowDown` — Move focus to next header
- `ArrowUp` — Move focus to previous header
- `Home` — Move focus to first header
- `End` — Move focus to last header
- `Enter` — Toggle focused panel
- `Space` — Toggle focused panel

## Common questions

**Which frameworks is Accordion — Single Mode available in?**

Accordion — Single Mode ships as Vanilla, React + CSS and React + Tailwind — HTML, CSS, JS and React source you can copy, download or clone into Atheros AI Builder.

**Is Accordion — Single Mode free?**

Accordion — Single Mode is a premium component. Anyone can preview it; the source, downloads and AI customisation are included with Atheros AI Pass.

**Does Accordion — Single Mode support dark mode?**

Yes. Accordion — Single Mode ships light and dark themes, both drawn from the Sienna design system's tokens. Switch the preview to dark mode to compare them.

## Get the code

Preview Accordion — Single Mode live, then sign in to copy or download the source, apply another design system, or ask the AI assistant to change it: https://builder.atheros.ai/components/accordion-single-mode

Every component on https://builder.atheros.ai is also reachable from Claude Code, Cursor and Codex through the Atheros MCP server (paid plans). Component index: https://builder.atheros.ai/llms-components.txt
