An entrance that resolves from blur to sharp.
Installation
Install the packages
npm install @prequelui/react motion@prequelui/react reuses the primitive library your components already depend on.
Add the component
npx shadcn@latest add https://animate.prequelui.terravidhal.me/r/blur.jsonnpx shadcn@latest add https://animate.prequelui.terravidhal.me/r/blur.json
Turn on the motion
npx @prequelui/cli@latest animate blurThe CLI finds the component through components.json, swaps the import and removes the CSS animation classes that Motion replaces.
Usage
Import the component and compose it exactly like the primitive it wraps. Motion is enabled by default; the tempo prop scales every duration and softens every spring.
import { Blur } from "@/components/prequelui/effects/blur";
export default function Demo() {
return (
<Blur initialBlur={12} blur={0} delay={100} className="text-4xl font-medium">
From soft to sharp.
</Blur>
);
}import { Blur } from "@/components/prequelui/blur";
export function Variant() {
return (
<Blur tempo={1.2}>
…
</Blur>
);
}Animation
The element starts with a filter and resolves to sharp on the entrance spring. Nothing moves: only the blur radius changes, so the layout and the text metrics are untouched.
- Entrance spring: stiffness 200, damping 20.
- Delay is expressed in milliseconds and added to the transition delay.
- The list variant staggers each child by the holdDelay value.
- Reduced motion starts at blur 0.
API Reference
Each part accepts the usual HTML props in addition to the motion props below. No accessibility prop is hidden behind the animation layer.
Blur
| Prop | Type | Default |
|---|---|---|
| initialBlur | number | 10 |
| blur | number | 0 |
| delay | number | 0 |
| inView | boolean | false |
| inViewOnce | boolean | true |
| inViewMargin | string | "0px" |
| transition | Transition | component spring or tween |
| asChild | boolean | false |
| className | string | — |
Blurs
| Prop | Type | Default |
|---|---|---|
| holdDelay | number | 0 |
| children | ReactElement[] | — |