Skip to content
VenusUI
Get started

Lamp

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

Preview

Installation

npx shadcn@latest add @venusui/lamp

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/lamp.tsx

Usage

The code behind the preview above.

lamp-demo.tsx

import { Lamp } from "@/components/ui/lamp"

export default function LampDemo() {
  return (
    <div className="dark w-full overflow-hidden rounded-xl border bg-background text-foreground">
      <Lamp className="px-6 pt-36 pb-16 text-center">
        <h2 className="text-3xl font-semibold tracking-tight sm:text-4xl">Built in the spotlight</h2>
        <p className="mt-3 text-sm text-muted-foreground">A lamp lights whatever you put under it.</p>
      </Lamp>
    </div>
  )
}

API reference

PropTypeDefaultDescription
colorstring"oklch(0.78 0.14 220)"Color of the light. Any CSS color.
childrenReactNode—Content lit by the lamp, usually a heading. Leave top padding (about pt-40) so it sits under the light.

All <div> props, including className.

Requirements

  • Tailwind CSS v4. The CLI adds the lamp-open keyframes and --animate-lamp-open. Works in Server Components.

Customization

  • Made for dark backgrounds; on light ones, use a deeper color.
  • Give the content below enough top padding to sit under the cones.

Accessibility

  • The light is decorative (aria-hidden).
  • With reduced motion the lamp is already open.

Troubleshooting

The light is cut off at the sides.
The cones are up to 30rem wide each; give the parent enough width or reduce them in the file.
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

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.

Loading preview

Meteors

Backgrounds

Streaks of light falling diagonally across a card or section.