uiniverse

animations

ScaleIn

Animates children with a scale + fade entrance on mount or viewport entry.

v1.0.0react >=18next >=14tailwind >=4motion >=12
entrancescrollscalezoomrevealgrow

Preview

Loading preview...

Props

PropTypeDefaultDescription
children*ReactNodeContent to animate
presetMotionPresetNamescaleInMotion preset from the token system
scalenumber0.92Initial scale value before animation (0-1)
delaynumberCustom delay in milliseconds
triggerOnViewbooleantrueAnimate when element enters viewport
viewThresholdnumber0.2Fraction of element visible before triggering
oncebooleantrueOnly animate once
classNamestringAdditional Tailwind classes

Slots

SlotTypeRequiredDescription
childrenReactNodeYesContent to scale in

Layout

Display: block
Responsive: No

Wraps children in an animated div with scale + opacity transition.

Examples

Basic usage

<ScaleIn>
  <div className="rounded-xl bg-neutral-900 p-8">Scales into view</div>
</ScaleIn>

Pop-in effect

<ScaleIn preset="popIn" scale={0.8}>
  <button className="px-6 py-3 bg-accent text-white">Click me</button>
</ScaleIn>

Staggered cards

<StaggerGroup stagger="normal">
  <ScaleIn><Card title="Plan A" /></ScaleIn>
  <ScaleIn><Card title="Plan B" /></ScaleIn>
  <ScaleIn><Card title="Plan C" /></ScaleIn>
</StaggerGroup>

AI Usage Hint

Use ScaleIn for elements that should grow into view — buttons, cards, images, modals. Use preset='popIn' for a bouncier entrance with spring physics. The 'scale' prop controls initial size (0.92 = subtle grow, 0.5 = dramatic zoom). Combine with StaggerGroup for cascading card entrances.

Works Well With

StaggerGroupFadeUp