Collapsible
The Collapsible component is used to show hide/show items.
1. Import
KUMUI exports 3 Collapsible-related components:
import { Collapsible, CollapsibleTrigger, CollapsibleContent } from "@rohitgadekar/kimui";
2. Usage
3. API
3.1 Collapsible
| Attribute | Type | Description | Default |
|---|---|---|---|
| open | boolean | Controls whether the collapsible content is open or closed. | false |
| onOpenChange | function | Callback function triggered when the collapsible's open state changes. | - |
| className | string | Custom CSS class for styling the Collapsible component. | - |
3.2 CollapsibleTrigger
| Attribute | Type | Description | Default |
|---|---|---|---|
| children | React.ReactNode | Content inside the CollapsibleTrigger. Typically a button or link to toggle the collapsible content. | - |
| className | string | Custom CSS class for styling the trigger element. | - |
3.3 CollapsibleContent
| Attribute | Type | Description | Default |
|---|---|---|---|
| children | React.ReactNode | Content to display when the collapsible is open. This can be any React nodes like text, images, or other components. | - |
| className | string | Custom CSS class for styling the content of the collapsible section. | - |