Skip to content
VenusUI
Get started

Ripple Background

Concentric rings that gently pulse from the center, e.g. behind an icon.

Preview

Installation

npx shadcn@latest add @venusui/ripple-background

Run this in a project set up with shadcn. If you haven’t set it up yet, run npx shadcn@latest init first.

Files added to your project

Paths use the default shadcn aliases. The CLI follows the aliases in your components.json.

  • @/components/ui/ripple-background.tsx

Usage

The code behind the preview above.

ripple-background-demo.tsx

import { Radio } from "lucide-react"

import { RippleBackground } from "@/components/ui/ripple-background"

export default function RippleBackgroundDemo() {
  return (
    <div className="relative flex h-72 w-full max-w-lg items-center justify-center overflow-hidden rounded-xl border bg-background">
      <RippleBackground />
      <span className="relative inline-flex size-14 items-center justify-center rounded-full border bg-card">
        <Radio className="size-6" aria-hidden="true" />
      </span>
    </div>
  )
}

API reference

PropTypeDefaultDescription
ringsnumber6Number of rings.
sizenumber160Diameter of the innermost ring, in pixels.
stepnumber90Extra diameter per ring, in pixels.

All <div> props, including className.

Requirements

  • Tailwind CSS v4. The CLI adds the ripple-ring keyframes and --animate-ripple-ring to your CSS. Works in Server Components.

Customization

  • Rings fade toward the edges with a radial mask. Remove the mask class for hard edges.
  • Center an icon or avatar on top by placing it after the background with relative.

Accessibility

  • Decorative: aria-hidden.
  • Rings stay still when the user prefers reduced motion.

Troubleshooting

Rings are off-center.
The parent must be the positioned element (relative) whose center you want.
Unknown registry "@venusui"
Your shadcn CLI couldn’t find the namespace in the shadcn registry index. Use the latest CLI (npx shadcn@latest), install by URL, or register it with its address: npx shadcn@latest registry add @venusui=https://venusui.com/r/{name}.json.
No components.json found
Run npx shadcn@latest init in your project first.
Loading preview

Soft, blurred color fields that drift slowly behind content.

Loading preview

Background Beams

Backgrounds

Curved lines across a section with light traveling along them.

Loading preview

Beam Rain

Backgrounds

Beams of light fall to the floor and burst into sparks when they land.