Collapsible
One section that opens and closes.
In Brand expressive
See it live
Start Storybook to see it live:
npm run storybookWhen to use it
In Brand expressive: One block of extra detail people may skip. Not for a section's one big idea.
- 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
- Headlines are short and bold. Three to six words.
- Verbs that move: Join, Try, Go.
- Playful in headlines, plain in errors.
- Use: Join, Drop, Go, Love. Avoid: Synergy, Leverage, Kindly.
The labels components use, from the voice tokens:
content.action.commit: Gocontent.action.cancel: Not nowcontent.action.destroy: Removecontent.action.retry: Try againcontent.action.empty-action: Explore the drop
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.