Fade

A simple opacity entrance tied to view or scroll.

fade.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/fade.json

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

3

Turn on the motion

npx @prequelui/cli@latest animate fade

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.

fade.tsx
import { Fade } from "@/components/prequelui/effects/fade";

export default function Demo() {
  return (
    <Fade opacity={1} className="text-4xl font-medium">
      A quiet entrance.
    </Fade>
  );
}
import { Fade } from "@/components/prequelui/fade";

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

Animation

The simplest entrance in the catalogue: a single opacity value on the entrance spring. Because it only touches opacity, it can be composed under a blur, a slide or a zoom without competing for the same property.

  • Spring: stiffness 200, damping 20.
  • Initial and final opacity are both configurable.
  • The list variant staggers the children by holdDelay.
  • Reduced motion keeps the fade; opacity is not a travel effect.
spring 200 / 20opacity 0 → 1staggered listreduced motion keeps fade

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.

Fade

PropTypeDefault
initialOpacitynumber0
opacitynumber1
delaynumber0
inViewbooleanfalse
inViewOncebooleantrue
inViewMarginstring"0px"
transitionTransitioncomponent spring or tween
asChildbooleanfalse
classNamestring—

Fades

PropTypeDefault
holdDelaynumber0
childrenReactElement[]—

Built by Vidhal. The source is available on GitHub.

Last updated: 11/17/2026