Collapsible
Una sección que se abre y se cierra; su título es un botón que dice si está abierta.
import { Collapsible } from '@sypnia/ui/react'
En esta página
Preguntas
In the region you chose when you made the project.
Código
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>
);
} Cuándo usarlo
Úsalo cuando
- Preguntas y respuestas, detalles que la mayoría se salta.
No lo uses cuando
- Ocultar lo que la mayoría necesita: muéstralo.
Para todos
- El título es un encabezado con un botón adentro; Enter y Espacio la abren y la cierran; el estado se anuncia.
Props
| Collapsible | Tipo | Por defecto |
|---|---|---|
titleobligatorioWhat 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 |