Slide

An entrance that arrives from one side.

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

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

3

Turn on the motion

npx @prequelui/cli@latest animate slide

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.

slide.tsx
import { Slide } from "@/components/prequelui/effects/slide";

export default function Demo() {
  return (
    <Slide direction="left" offset={60} className="rounded-xl border px-5 py-4">
      Slide into place.
    </Slide>
  );
}
import { Slide } from "@/components/prequelui/slide";

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

Animation

Slide uses one axis and one offset. The direction chooses between x and y and the sign of the travel, while the entrance spring carries the element to zero. Under reduced motion the same component falls back to a plain fade.

  • Entrance spring: stiffness 200, damping 20.
  • Default direction is up with a 100 px offset.
  • The crossing direction reads naturally: right and down enter from the negative side.
  • The list variant staggers children by holdDelay.
spring 200 / 20offset 100 pxsingle axisfade fallback

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.

Slide

PropTypeDefault
direction"up" | "down" | "left" | "right""up"
offsetnumber100
delaynumber0
inViewbooleanfalse
inViewOncebooleantrue
inViewMarginstring"0px"
transitionTransitioncomponent spring or tween
asChildbooleanfalse
classNamestring—

Slides

PropTypeDefault
holdDelaynumber0
childrenReactElement[]—

Built by Vidhal. The source is available on GitHub.

Last updated: 11/17/2026