WebberUI

Vortex Background

A swirling vortex wave background where particle streamlines converge on the center — a good fit for CTA sections.

A vortex background simulated as a canvas 2D particle flow field: hundreds of streamlines spiral inward toward the center, overlaid with organic waves and a glow, and the cursor can perturb the streamlines near it.

Loading preview…
npx shadcn@latest add https://webberui.com/r/vortex-background.json

Playground

Tune the props live — the code snippet updates as you go, so you can dial in the look you want before copying it.

420
1
1
2.2
0
<VortexBackground />

Installation

npx shadcn@latest add https://webberui.com/r/vortex-background.json

Or, once registries are configured in components.json, install it as @webberui/vortex-background.

Usage

import { VortexBackground } from "@/components/ui/vortex-background";

<VortexBackground
  interactive
  className="flex h-[320px] w-full items-center justify-center rounded-xl"
>
  <h3 className="text-3xl font-semibold text-white">Step into the eye of the vortex</h3>
</VortexBackground>

Container height, centering, and other layout go straight on className; avoid viewport height units (such as h-screen) and use a fixed or content-driven height so the background stays self-contained and bounded.

Props

PropTypeDefaultDescription
particleCountnumber420Number of particles; lower it on mobile to save performance
colorsstring[]Magenta → indigo → cyanStreamline colors, applied by cycling through the list
speednumber1Rotation speed multiplier — higher spins faster
spinnumber1Vortex strength — higher pulls inward more aggressively
turbulencenumber2.2Wave amplitude — the perturbation layered onto the flow direction
particleWidthnumber1.4Base line width (px)
backgroundColorstring"#070316"Trail base color; a dark color is recommended so the glow stands out
glownumber0Glow blur amount (px) — higher is dreamier
interactivebooleanfalseThe cursor perturbs nearby streamlines (mouse only)
grainbooleanfalseOverlays low-opacity grain to reduce banding
classNamestringContainer styling, forwarded (layout, height, corner radius)

Accessibility

  • When the user has "reduce motion" enabled at the system level, only a single static frame of the vortex is drawn — neither the animation loop nor the interaction starts
  • The background layer carries aria-hidden, so foreground content is announced as usual
  • Both cancelAnimationFrame and the ResizeObserver are cleaned up when the component goes away

On this page