Collapsible
One section that opens and closes.
In Multi-brand
See it live
Start Storybook to see it live:
npm run storybookWhen to use it
In Multi-brand: One block of extra detail on a form, such as more options. Not for frequent questions; accordion holds those.
- Use it when: A single block of extra detail people may want: more filters, advanced options.
- Not when: Several stacked sections (accordion), or content everyone needs.
Instead:
- Accordion: A stack of sections.
Words
- Shared structure: object, state, next step.
- Brand tone lives in headlines and marketing copy, not in errors.
- Errors and confirmations read the same in every brand.
- Use: Get started, Plan, Order. Avoid: Brand-specific words in errors, Jargon.
The labels components use, from the voice tokens:
content.action.commit: Savecontent.action.cancel: Cancelcontent.action.destroy: Removecontent.action.retry: Try againcontent.action.empty-action: Get started
See Voice and tone for the whole voice.
Accessibility and keyboard
| Keyboard | What happens | Not |
|---|---|---|
| undefined | Enter or Space opens and closes. | undefined |
Test before you ship:
- The trigger is a button that says whether it is open. undefined
Use it in code
npx open-ds add collapsible
The component reads only component keys and semantic tokens, so it follows the brand and mode on <html>.
Tokens it reads
Collapsible sets no colors, corners or shadows of its own; it takes them from the components inside it.