Effect

Fade, blur, slide and zoom composed into one entrance.

effect.tsx

Installation

1

Install the packages

npm install @prequelui/react motion

@prequelui/react reuses the primitive library your components already depend on.

2

Add the component

npx shadcn@latest add https://animate.prequelui.terravidhal.me/r/effect.json

npx shadcn@latest add https://animate.prequelui.terravidhal.me/r/effect.json

3

Turn on the motion

npx @prequelui/cli@latest animate effect

The 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.

effect.tsx
import { Effect } from "@/components/prequelui/effects/effect";

export default function Demo() {
  return (
    <Effect
      fade
      blur
      zoom
      slide={{ direction: "up", offset: 24 }}
      className="rounded-xl border p-6"
    >
      Four properties, one gesture.
    </Effect>
  );
}
import { Effect } from "@/components/prequelui/effect";

export function Variant() {
  return (
    <Effect tempo={1.2}>
      …
    </Effect>
  );
}

Animation

Effect composes the four entrance primitives on a single element. Each option can be a boolean or a configuration object, and the hidden and visible variants are built once so the properties animate together on the same spring.

  • Slide defaults to 100 px upwards; each direction maps to x or y.
  • Fade defaults to opacity 0 → 1; zoom to scale 0.5 → 1; blur to 10 px → 0.
  • Reduced motion drops slide and zoom and keeps the fade.
  • The list variant staggers children by holdDelay.
spring 200 / 20fade · blur · slide · zoomdelay in msin-view once

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.

Effect

PropTypeDefault
fadeboolean | { initialOpacity, opacity }false
blurboolean | { initialBlur, blur }false
slideboolean | { direction, offset }false
zoomboolean | { initialScale, scale }false
delaynumber0
inViewbooleanfalse
inViewOncebooleantrue
inViewMarginstring"0px"
transitionTransitioncomponent spring or tween
classNamestring—

Effects

PropTypeDefault
holdDelaynumber0
childrenReactElement[]—

Built by Vidhal. The source is available on GitHub.

Last updated: 11/17/2026