Render a Button through render on CollapsibleTrigger. Put the space above the content on CollapsibleContent (className="pt-2"), not as a gap on the root, so the page does not jump.
The sample also uses Button. One command adds them with this item:
advanced-options.tsx
Collapsible
<div>| Prop | Type | Default | Description | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| class | string | — | |||||||||||||||||||
From Base UICollapsible.RootBase UI docs | |||||||||||||||||||||
| open | boolean | — | Whether the collapsible panel is currently open. To render an uncontrolled collapsible, use the defaultOpen prop instead. | ||||||||||||||||||
| default | boolean | false | Whether the collapsible panel is initially open. To render a controlled collapsible, use the open prop instead. | ||||||||||||||||||
| on | — | Event handler called when the panel is opened or closed. | |||||||||||||||||||
| |||||||||||||||||||||
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. | ||||||||||||||||||
CollapsibleTrigger
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
CollapsibleChevron
<svg>| Prop | Type | Default | Description |
|---|---|---|---|
| direction | "down""end" | — | down (default) for a panel that opens below, end for a row that opens rows under it. |
| variant | "bulk""duotone""solid""stroke""twotone" | — | stroke (default): 1.5 strokes. solid: the body filled, inner details cut through. duotone: a 40% fill under the stroke. twotone: the details at 40%. bulk: the body filled at 40% with no outline, the details at full color. |
| corners | "round""sharp" | — | round (default): round caps and joins, soft corners. sharp: square caps, miter joins. |
| open | boolean | — | Open: the chevron turns (down → up, end → down) on the panelBounce spring. |
| ...props | <svg> attributes | — | Every other attribute goes to the <svg>, with a ref. |
CollapsibleContent
<div>| Prop | Type | Default | Description | |||||||
|---|---|---|---|---|---|---|---|---|---|---|
| class | string | — | ||||||||
From Base UICollapsible.PanelBase UI docs | ||||||||||
| keep | boolean | false | Whether to keep the element in the DOM while the panel is hidden. This prop is ignored when hiddenUntilFound is used. | |||||||
| render | — | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render. | ||||||||
| ||||||||||
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. | |||||||
AnimatedChevronIcon
<svg>| Prop | Type | Default | Description |
|---|---|---|---|
| direction | "down""end" | "down" | down (default) for a panel that opens below, end for a row that opens rows under it. |
| variant | "bulk""duotone""solid""stroke""twotone" | — | stroke (default): 1.5 strokes. solid: the body filled, inner details cut through. duotone: a 40% fill under the stroke. twotone: the details at 40%. bulk: the body filled at 40% with no outline, the details at full color. |
| corners | "round""sharp" | — | round (default): round caps and joins, soft corners. sharp: square caps, miter joins. |
| open | boolean | false | Open: the chevron turns (down → up, end → down) on the panelBounce spring. |
| ...props | <svg> attributes | — | Every other attribute goes to the <svg>, with a ref. |
| Enter | Opens or closes the panel. |
|---|---|
| Space | Opens or closes the panel. |
- ButtonA button for an action on the page, such as Save or Delete. It has 9 looks and 5 sizes, and a spinner that keeps its width while the action runs.
- DialogA window over the page for one task, such as a short form or a detail view. The page behind waits until people close it.
- AccordionPick Accordion for a stack of headings where each one opens its own panel.
- SpoilerPick Spoiler to cut long content at a height with a fade and a Show more button, with no title row.
Built with
Installs with Collapsible







