Skip to content
nexubDesign System
v2.4.0

Components · Motion

Collapse

StableSince v0.0.1

Expands and collapses content along the block axis.

import { Collapse } from '@nexub/react';

Examples

Default

Toggle

Props

Props
PropTypeDefaultDescription
inrequiredboolean—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.
unmountOnExitbooleanfalseRemoves the element from the DOM after the collapse animation completes.
asReact.ElementType'div'The HTML element or component to render as the wrapper.
childrenrequiredReact.ReactNode—Content to expand and collapse.

On iOS & Android