#067
Single
A single-open Accordion with three FAQ questions about theming, where opening one closes the others.
Hand this to your AI. It names the exact library parts, timings and accessibility promises of this demo.
Build the "Single" pattern (@codeatlasdev/ui demo #067, surfaces/accordion) in my app.
Call get_demo({ ids: ["#067"] }) first and keep its structure. It needs @codeatlasdev/[email protected].
Use: FAQ sections where only one answer should be visible at a time.
Keep these library parts, with the props and tokens the demo uses:
- Accordion, AccordionItem from "@codeatlasdev/ui"
Behaviour to keep:
- `<Accordion type="single">`
- 3 items: `<AccordionItem value="a1" title="What is a surface style?">`, `value="a2"` and `value="a3"`
- Item titles: What is a surface style?, Do I need to change components to restyle the app?, Can I nest a Surface inside a Card?
- The accordion is uncontrolled, nothing is bound
- Wrapped in `.wrap` with `max-width: 560px`
Reduced motion: the demo handles it; keep that branch.
Keyboard: operable; keep the focus order and key handling.
Change only the copy and the data. Use the theme tokens (--ca-*), never raw colours. Library parts
- Accordion
@codeatlasdev/ui - AccordionItem
@codeatlasdev/ui
How it is built
- `<Accordion type="single">`
- 3 items: `<AccordionItem value="a1" title="What is a surface style?">`, `value="a2"` and `value="a3"`
- Item titles: What is a surface style?, Do I need to change components to restyle the app?, Can I nest a Surface inside a Card?
- The accordion is uncontrolled, nothing is bound
- Wrapped in `.wrap` with `max-width: 560px`
Related
Loading source.