Components · Motion
Expands and collapses content along the block axis.
import { Collapse } from '@nexub/react';| Prop | Type | Default | Required | Description |
|---|---|---|---|---|
| in | boolean | — | ✓ | When true, expands the content to its natural height. When false, collapses it to zero height. |
| duration | 'instant' | 'fast' | 'normal' | 'slow' | 'slower' | 'normal' | — | Controls the animation speed using the design token scale. |
| easing | 'linear' | 'in' | 'out' | 'in-out' | 'out-expo' | 'spring' | 'out' | — | Easing curve applied to the animation. |
| unmountOnExit | boolean | false | — | Removes the element from the DOM after the collapse animation completes. |
| as | React.ElementType | 'div' | — | The HTML element or component to render as the wrapper. |
| children | React.ReactNode | — | ✓ | Content to expand and collapse. |