Components

Lamp

A lamp light effect for React and Tailwind CSS: a thin bar hangs over your section and two soft cones of light widen into place as it scrolls into view, lighting the heading below. Built from conic gradients and compositor-only transforms, in any color.

  • Section
  • Scroll reveal
  • Conic gradients
  • Wraps content
  • Reduced-motion safe

Introducing workflows

Automate reviews, deploys and alerts with a few lines of config.

Installation

$ npx shadcn@latest add https://duskui.com/r/lamp.json

Unlike the other backgrounds, Lamp wraps its content: children render below the bar, and the section gets bg-background so the dark housing above the bar blends in. Override it with a class.

Usage

section.tsx
import { Lamp } from "@/components/dusk/lamp/lamp"

export function Section() {
  return (
    <Lamp className="min-h-[32rem]">
      <h2 className="text-5xl font-semibold">Build in the light</h2>
    </Lamp>
  )
}

Examples

Color & spread

color tints the bar, cones and haze. spread is how far each half of the cone opens from straight down, and offset moves the bar (and the content below it) up or down.

Release notes

color="#7dd3fc"

Release notes

color="#c4b5fd" spread={34}

API Reference

Any other div prop is passed to the root. Content starts offset + 3.5rem from the top; change it with a pt-* class.

PropTypeDefaultDescription
colorstring"#cbd5e1"Light color. Any CSS color.
offsetnumber112Distance in px from the top to the lamp bar.
spreadnumber58Half-angle of the light cone in degrees, 20–80.
oncebooleantrueReveal only the first time the lamp enters the viewport.
childrenReactNode—Content lit by the lamp, usually a heading.
classNamestring—Merged onto the root section.

Accessibility

  • The light is a decorative layer (aria-hidden, pointer-events-none); your children stay normal, readable, focusable content.
  • With prefers-reduced-motion the light fades in without widening.
  • Use a real heading element for the lit text so the section keeps its place in the document outline.
  • The haze brightens the area right under the bar; check contrast for small text placed there.