Click

A ring, ripple, crosshair or burst played at the click point.

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

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

3

Turn on the motion

npx @prequelui/cli@latest animate click

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.

click.tsx
import { Click } from "@/components/prequelui/effects/click";

export default function Demo() {
  return (
    <Click variant="ring" size={100} duration={400}>
      <div className="grid h-40 place-items-center rounded-xl border border-dashed">
        Click anywhere
      </div>
    </Click>
  );
}
import { Click } from "@/components/prequelui/click";

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

Animation

A pointer press spawns one short-lived effect at the exact viewport point, in a fixed overlay that ignores the pointer. Five variants share the same timing controls but use different geometry: a filled ripple, an expanding ring, a crosshair, a radial burst and a ring of dots.

  • Default duration: 400 ms, with the overlay removed 320 ms after the animation.
  • The ripple scales from 0.2 to 1 and fades; the ring grows while its stroke thins to zero.
  • The crosshair and the burst travel outwards on an ease-in-out and shrink as they fade.
  • No listener and no overlay is created when reduced motion is active.
duration 400 ms5 variantsfixed portalpointer-events none

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.

Click

PropTypeDefault
variant"ripple" | "ring" | "crosshair" | "burst" | "particles""ring"
sizenumber100
durationnumber400
colorstring"currentColor"
disabledbooleanfalse
scopeRefObject<HTMLElement>document
childrenReactNode—

Built by Vidhal. The source is available on GitHub.

Last updated: 11/17/2026