Background

Hole

A tunnel of rings with particles rising toward the camera.

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

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

3

Turn on the motion

npx @prequelui/cli@latest animate hole

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.

hole.tsx
import { HoleBackground } from "@/components/prequelui/backgrounds/hole";

export default function Demo() {
  return (
    <div className="relative h-96 overflow-hidden rounded-xl">
      <HoleBackground />
    </div>
  );
}
import { Hole } from "@/components/prequelui/hole";

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

Animation

A tunnel is drawn on canvas: elliptical rings travel toward the camera while shrinking, particles rise inside the same cone, and a vertical colour wash sits behind them. The whole scene is a single compositor-friendly canvas.

  • Rings follow a non-linear phase so they accelerate as they approach.
  • Particles reset above the top edge with a fresh size and opacity.
  • The canvas is capped at 2× device pixel ratio and redrawn at most once per frame.
  • Reduced motion paints one composed frame and stops the loop.
34 rings80 particlesDPR ≤ 2single canvas

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.

HoleBackground

PropTypeDefault
ringsnumber34
particlesnumber80
strokeColorstring"255,255,255"
speednumber1
pausedbooleanfalse
classNamestring—

Built by Vidhal. The source is available on GitHub.

Last updated: 11/17/2026