Components · Motion
Scale
StableAdded v0.0.1
Scales content in/out from its center.
import { Scale } from '@nexub/react';Playground
Props
Scaled content
<Scale in>…</Scale>Examples
Default
Toggle
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| inrequired | boolean | — | When true, scales content in from 0 to 1. When false, scales it back down to 0. |
| duration | 'instant' | 'fast' | 'normal' | 'slow' | 'slower' | 'normal' | Controls the animation speed using the design token scale. |
| unmountOnExit | boolean | false | Removes the element from the DOM after the exit animation completes. |
| as | React.ElementType<any, keyof React.JSX.IntrinsicElements> | 'div' | The HTML element or component to render as the wrapper. |
| children | React.ReactNode | — | Content to animate. |
| initialScale | number | 0.95 | The scale value at the start/end of the animation (when in={false}). |
On iOS & Android
Web only
Scale has no @nexub/react-native twin. On phones, follow the platform pattern instead, or compose it from the native components listed on the React Native page.