Collapse
An expandable disclosure with a summary.
summary is required and accepts markup — for example, text with a Badge. Set defaultOpen initially, or open with onOpenChange for a controlled disclosure.
Live example
Summary
Example controls
Usage
import { Collapse } from '@prosazhin/pbcomponents';
<Collapse summary='Summary'>Collapse item content</Collapse>;Component API
| Prop | Type / variants | Purpose | Default |
|---|---|---|---|
summary | ReactNode | Expandable section heading: text or markup, for example with a Badge. | — |
children | ReactNode | Content of the expanded section. | — |
open | boolean | Controlled open state. | — |
defaultOpen | boolean | Initial open state when uncontrolled. | false |
onOpenChange | (open: boolean) => void | Called when the section opens or closes. | — |
contentClassName | string | Class of the expanded content. | — |
className | string | Class of the root element. | — |
Native HTML attributes are accepted where the component renders the corresponding element. className props only affect styling.