Collapsible
A section that opens and closes; its title is a button that says whether it is open.
import { Collapsible } from '@sypnia/ui/react'
On this page
Questions
In the region you chose when you made the project.
Code
import { Collapsible } from '@sypnia/ui/react';
export default function Faq() {
return (
<div style={{ maxWidth: '40rem' }}>
<Collapsible title="Where is my data kept?" defaultOpen>In the region you chose when you made the project.</Collapsible>
<Collapsible title="Can I export everything?">Yes: every table as CSV, or the whole database as a Postgres dump.</Collapsible>
<Collapsible title="What happens when I delete a project?">It is kept for 30 days and can be restored; after that it is gone.</Collapsible>
</div>
);
} When to use it
Use it when
- Questions and answers, details most people skip.
Do not use it when
- Hiding what most people need: show it.
For everyone
- The title is a heading with a button inside; Enter and Space open and close it; the state is announced.
Props
| Collapsible | Type | Default |
|---|---|---|
titlerequiredWhat the section is about; pressing it opens and closes. | ReactNode | |
className | string | |
defaultOpen | boolean | |
levelHeading level of the title, for the page outline. | 2 | 3 | 4 | 3 |
onOpenChange | ((open: boolean) => void) | |
open | boolean |