Collapse
Collapse is a flexible component for showing and hiding content behind a title. It supports standalone and accordion modes, arrow/plus variants, and toggleable open/close states.
Collapse is a flexible component for showing and hiding content behind a title. It supports standalone and accordion modes, arrow/plus variants, and toggleable open/close states.
The Collapse components include the following:
Collapse and toggles the state when clicked.Collapse is open.The main Collapse component. Can be used standalone or inside an Accordion. Supports arrow/plus styles, controlled open/close, and toggle mode.
| Collapse Props | Type | Description |
|---|---|---|
variant | string | Sets the variant of the collapse indicator. Options: |
| arrow | boolean | Shortcut for |
| plus | boolean | Shortcut for |
open | boolean | Controls whether the collapse is open. Useful for manual control. |
close | boolean | Controls whether the collapse is closed. Useful for manual control. |
toggle | boolean | Uses a hidden toggleable input (checkbox for standalone, radio for Accordion) to control open/close state. |
value | any | The value of this Collapse (used for Accordion integration). |
| Collapse Slots | Description |
|---|---|
default | The default slot. Place CollapseTitle and CollapseContent as children here. |
The title/header area for the Collapse. Clicking toggles open/close. Place inside a Collapse component.
| CollapseTitle Slots | Description |
|---|---|
default | The default slot. Content to be displayed as the collapse title. |
The collapsible content area. Place inside a Collapse component. Only visible when open.
| CollapseContent Slots | Description |
|---|---|
default | The default slot. Content to be displayed when the Collapse is open. |
Unstyled collapse example, showing basic usage without extra classes.
Demonstrates the variant prop with arrow and plus options.
variant="arrow".variant="plus".Demonstrates the arrow and plus boolean shortcut props.
arrow boolean shortcut.plus boolean shortcut.Collapse components that are open by default using the open prop.
Keep the collapse closed by default using the close prop.
Collapse components controlled by a toggleable input using the toggle prop, with different color themes.