Collapsible
Collapsible component, one section that opens and closes with a smooth height animation, with icon, description, controlled state and a plain variant.
How to use it
Run npx @blossomui/react add collapsible, or copy src/components/UI/Collapsible/Collapsible.tsx into your React project and import it.
import { Collapsible } from './components/ui/Collapsible'Props
CollapsibleProps
| Prop | Type | Description |
|---|---|---|
| title (required) | ReactNode | What the user presses to open or close the content. |
| description | ReactNode | Small text under the title. |
| icon | ReactNode | Element shown before the title, for example an icon. |
| children (required) | ReactNode | |
| open | boolean | Controlled state. Use together with `onOpenChange`. |
| defaultOpen | boolean | Initial state when the component is not controlled. |
| onOpenChange | (open: boolean) => void | |
| variant | 'plain' | 'bordered' | `plain` has no frame, `bordered` draws a card around it. |
| color | string | Accent color of this component: any CSS color. Without it the component uses `--blossom-accent`, which is pink by default. |
| disabled | boolean | |
| className | string |