An entrance that brings elements into focus on load or when they scroll into view.
Design
Build
Ship
Installation
Usage
import { Blur, Blurs } from '@animate-ui/react/primitives/effects/blur';
export function Hero() {
return (
<>
<Blur>
<h1>Animated primitives for React</h1>
</Blur>
{/* Staggered: each child starts 100ms after the previous one. */}
<Blurs holdDelay={100}>
<Card />
<Card />
<Card />
</Blurs>
</>
);
}With asChild, the animation is applied to your element instead of a wrapping div.
Animation
- The element sharpens from
initialBlurtobluron a spring (stiffness 200, damping 20): about 250ms from 10px to sharp. - Under reduced motion, it still comes into focus: a blur doesn't move anything.
inViewwaits for the element to scroll into view, once by default.<AnimateUIProvider tempo>paces the default spring.
API Reference
Blur
| Prop | Type | Default |
|---|---|---|
asChild? | boolean | false |
initialBlur? | number | 10 |
blur? | number | 0 |
delay? | number | 0 |
transition? | Transition | { type: 'spring', stiffness: 200, damping: 20 } |
inView? | boolean | false |
inViewOnce? | boolean | true |
inViewMargin? | string | '0px' |
...props? | HTMLMotionProps<'div'> | - |
Blurs
Wraps each child in a Blur, delaying each one a little more than the previous.
| Prop | Type | Default |
|---|---|---|
children | React.ReactElement | React.ReactElement[] | - |
holdDelay? | number | 0 |
...props? | BlurProps | - |