An entrance that combines fade, blur, slide and zoom on load or when elements scroll into view.
Design
Build
Ship
Installation
Usage
import { Effect, Effects } from '@animate-ui/react/primitives/effects/effect';
export function Hero() {
return (
<>
<Effect fade blur slide zoom>
<h1>Animated primitives for React</h1>
</Effect>
{/* Staggered: each child starts 100ms after the previous one. */}
<Effects holdDelay={100} fade blur slide zoom>
<Card />
<Card />
<Card />
</Effects>
</>
);
}With asChild, the animation is applied to your element instead of a wrapping div.
Animation
- Pick any combination of
fade,blur,slideandzoom.trueuses each effect's defaults; an object customizes it. - Everything animates together on one spring (stiffness 200, damping 20). Slide (
x/y) and zoom (scale) are hardware-accelerated transforms. - Under reduced motion, there is no travel or scale: the fade and the blur still play.
inViewwaits for the element to scroll into view, once by default.<AnimateUIProvider tempo>paces the default spring.
API Reference
Effect
| Prop | Type | Default |
|---|---|---|
asChild? | boolean | false |
fade? | boolean | { initialOpacity?: number; opacity?: number } | false |
blur? | boolean | { initialBlur?: number; blur?: number } | false |
slide? | boolean | { direction?: 'up' | 'down' | 'left' | 'right'; offset?: number } | false |
zoom? | boolean | { initialScale?: number; scale?: number } | false |
delay? | number | 0 |
transition? | Transition | { type: 'spring', stiffness: 200, damping: 20 } |
inView? | boolean | false |
inViewOnce? | boolean | true |
inViewMargin? | string | '0px' |
...props? | HTMLMotionProps<'div'> | - |
Effects
Wraps each child in an Effect, delaying each one a little more than the previous.
| Prop | Type | Default |
|---|---|---|
children | React.ReactElement | React.ReactElement[] | - |
holdDelay? | number | 0 |
...props? | EffectProps | - |