0.95 → 1
a beat later
plays on mount
Installation
One command drops the source into your repo — editable, with the provider and motion pulled in automatically.
npx shadcn add https://motion.asmitsah.dev/r/scale-in.jsonPrerequisiteInstall the provider base first
This component imports from @/lib/motion and needs <MotionProvider> mounted in your root layout — install the base once, before copying this component.
npx shadcn add https://motion.asmitsah.dev/r/provider.jsonStep 1Install the runtime dependency
npm install motionStep 2Copy the source into
components/motion/scale-in.tsxcomponents/motion/scale-in.tsx
Usage
Basic
Wrap any element — it settles 0.95 → 1 scale + fades in the first time it is 30% in view.
With delay
Offset sibling scale-ins by a beat to sequence them without a full Stagger.
Trigger on mount
Play immediately instead of waiting for scroll — for above-the-fold content, e.g. a modal or popover.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| children | ReactNode | — | Content that grows + fades in. |
| className | string | — | Passed straight through — ScaleIn becomes your layout element. |
| style | CSSProperties | — | Inline style passthrough. |
| delay | number | 0 | Seconds before this instance animates. |
| trigger | "inView" | "mount" | "inView" | Animate on scroll-into-view (once) or immediately on mount. |