Skip to content
VenusUI
Get started

Background Beams

Curved lines across a section with light traveling along them.

Preview

Installation

npx shadcn@latest add @venusui/background-beams

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/background-beams.tsx

Usage

The code behind the preview above.

background-beams-demo.tsx

import { BackgroundBeams } from "@/components/ui/background-beams"

export default function BackgroundBeamsDemo() {
  return (
    <div className="dark relative isolate flex h-80 w-full items-center justify-center overflow-hidden rounded-xl border bg-background text-foreground">
      <BackgroundBeams />
      <div className="text-center">
        <p className="text-3xl font-semibold tracking-tight">Join the waitlist</p>
        <p className="mt-2 text-sm text-muted-foreground">Light travels along every beam.</p>
      </div>
    </div>
  )
}

API reference

PropTypeDefaultDescription
countnumber18Number of beams.
colors[string, string]violet → skyStart and end color of the traveling light. Any CSS colors.

All <div> props, including className.

Requirements

  • Tailwind CSS v4. The CLI adds the beam-travel keyframes and --animate-beam-travel.

Customization

  • The faint lines use the text color; the moving light uses colors.
  • Place inside a relative element with isolate so it stays behind your content.

Accessibility

  • Decorative (aria-hidden).
  • The traveling light is hidden with reduced motion; the faint lines stay.

Troubleshooting

Beams cover the content.
Add relative isolate to the parent; the beams sit at -z-10.
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

Beam Rain

Backgrounds

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

Loading preview

Lamp

Effects

A glowing bar casting a cone of light that opens over the content below.

Loading preview

Meteors

Backgrounds

Streaks of light falling diagonally across a card or section.