Components
Collapsible
Single disclosure panel with a clickable title header and animated chevron.
Collapsible is a self-contained disclosure: clicking the title header toggles
its children open or closed, with a chevron that rotates to match. State is
managed internally (built on Headless UI's Disclosure), so just set defaultOpen
to control the initial state. Use it for "show more" sections, FAQs, or optional
settings. For grouped sections where opening one closes the others, use
Accordion.
Example
Preview
Disclosure state and focus management come from Headless UI.
import { Collapsible } from '@officina/ui';
function Faq() {
return (
<Collapsible title="What is included?" defaultOpen>
Every primitive ships with TypeScript types and theming support.
</Collapsible>
);
}API
| Prop | Type | Default | Description |
|---|---|---|---|
| children* | ReactNode | — | Collapsible content. |
| defaultOpen | boolean | — | Whether the panel starts open. |