Motion Kit

Canvas

Lava Lamp

Raymarched metaball blobs rendered with a smooth-min SDF and Fresnel edge lighting. Creates a fluid, organic lava lamp animation.

  • lit
  • ogl

Preview

Raymarched metaball blobs with smooth-min SDF blending and Fresnel edge lighting — fluid, organic lava lamp motion.
Attributes

Installation

pnpm dlx shadcn@latest add https://motion-kit-astro.vercel.app/r/lava-lamp.json

Usage

---
import "@/components/motion-kit/lava-lamp-element.ts";
---

<motion-lava-lamp
  color="#17181A"
  fresnel-color="#ff6900"
  speed="1.0"
  fresnel-power="3.0"
  radius="1"
  smoothness="0.1"
  class="w-full h-[500px]"
/>

API Reference

Attribute Type Default
color Base body color of the lava blobs. string #17181A
fresnel-color Color applied at blob edges via the Fresnel effect. string #ff6900
speed Animation speed multiplier. number 1.0
fresnel-power Controls the sharpness of the Fresnel edge glow. number 3.0
radius Base radius of the blobs. number 1
smoothness Smoothness of the blob blending (metaball merge factor). number 0.1
scale Scale multiplier for the lava field. number 1
rotation Lava field rotation in degrees. number 0
offset-x Horizontal offset in normalized viewport units. number 0
offset-y Vertical offset in normalized viewport units. number 0