127 Components

Lava Lamp

Backgrounds

True WebGL signed distance field (SDF) metaball lava lamp shader using polynomial smooth-minimum (smin) surface tension blending, 3D specular/Fresnel subsurface rim lighting, and pointer thermal attraction.

Smooth-Min Metaballs

Lava Lamp

Installation

Install directly into your project using the shadcn CLI or copy the source code manually.

Requires:lucide-reactclsxtailwind-merge
$npx shadcn@latest add "https://boseui.site/r/lava-lamp.json"

Props

TypeScript props supported by <LavaLamp />.

8 props
PropTypeDefaultDescription
blobCountnumber7Number of buoyant wax metaballs inside the vessel (3 to 12).
primaryColorstring"#FF3B00"Core molten wax hex color.
secondaryColorstring"#FFB800"Subsurface Fresnel rim and thermal highlight hex color.
backgroundColorstring"#0F071E"Ambient vessel background hex color.
speednumber1.0Thermal buoyancy convection speed multiplier.
viscositynumber0.45Smooth-minimum (`smin`) surface tension blending factor (0.15 to 0.85).
childrenReact.ReactNode—Optional foreground UI rendered above the lava lamp shader.
classNamestring—Additional Tailwind CSS classes for the root container.

Key Features

  • True polynomial smooth-minimum (`smin`) SDF blending with adjustable liquid surface tension.
  • Finite-difference 3D hemisphere normal reconstruction for glassy specular highlights and Fresnel rim glow.
  • Buoyant thermal wax cycle coupled with a gentle pointer heat attractor.

Keyboard & Accessibility

  • Marks the WebGL metaball canvas with `aria-hidden='true'`.
  • Interactive Magma, Cyber Acid, and Ultraviolet color presets are keyboard accessible.
  • Dark translucent HUD container preserves legible contrast over bright molten blobs.