Skip to content
Uxelith
Sign in
Prov1.0.0Backgrounds

Liquid Metal

Molten metal flowing behind your content, lit like a photo studio: the pointer drags ripples and carries the highlight, and a press drops a ripple. A WebGL surface in chrome, gold or iridescent, with no libraries.

Installs with Uxelith ProHow
Licence
Pro
Packages
2
Updated
19 Oct 2026
Live

Installation

Usage

example.tsx
import { LiquidMetal } from "@/components/liquid-metal"

export function Hero() {
  return (
    <LiquidMetal finish="chrome" className="flex min-h-[32rem] flex-col items-center justify-center px-6 text-center">
      <h1 className="text-5xl font-semibold tracking-tight">Pour the light.</h1>
      <p className="mt-3 text-muted-foreground">Move your pointer across the metal.</p>
    </LiquidMetal>
  )
}

Props

PropTypeDefaultDescription
finish"chrome" | "gold" | "iridescent""chrome"The metal itself: polished chrome, warm gold, or chrome with an oil-slick film.
colorsstring[][] (theme: --primary, --chart-2, --chart-4)Two or three colours for the studio lights the metal reflects. Any CSS colour.
flownumber1How fast the metal flows, from 0 (still) to 3.
autoplaybooleantrueWhen nobody is near, a lamp drifts across and now and then a drop falls. Off, the surface sleeps a few seconds after the pointer leaves.
interactivebooleantrueThe pointer drags ripples and carries the highlight; a press drops a ripple. Presses on links and buttons stay theirs.
scrimbooleantrueA soft shade of the background behind the middle, so text over bright metal stays readable. Turn it off when nothing sits on top.
momentnumberundefined (flows)Holds the flow still at this moment, in seconds of flow: a fixed shape for a calm hero, or the frame you capture. Ripples and the pointer still work.
captureRefRef<LiquidMetalHandle>—Gets { capture(width, height) }, which draws the surface as it is right now again at that size and resolves a PNG Blob: a 4K hero, a wallpaper, a social card. It works on a software renderer too, and rejects with a plain message when the device can't draw that size.
...propsHTMLAttributes<HTMLDivElement>—Any div attribute. Your className is merged last, so it wins; size the background with it.

Accessibility

  • The canvas and its still image are decorative and hidden from assistive technology; your content is ordinary markup above them.
  • A soft shade sits behind the middle, so text above keeps its contrast over bright highlights.
  • With prefers-reduced-motion it shows one still frame and ignores the pointer.
  • It pauses off-screen and in hidden tabs, and frees its GPU memory when removed.
  • Without WebGL2, on a software renderer, or on a device that can't hold a smooth frame rate even at low resolution, it shows a still image in your theme colours.

Changelog

  1. v1.0.0Latest

    First release.

More in Backgrounds

All 5 in Backgrounds
  • BackgroundsFree

    Fluid Ink

    Ink that flows like a real fluid behind your content: stir it with the pointer, press to burst colour, and watch it curl and fade. A WebGL fluid simulation in your theme colours, with no libraries.

  • BackgroundsPro

    Glass Lens

    A liquid glass orb follows the pointer and bends the page behind it: your headline magnifies through it, the rim splits light into colour, and pressing swells the glass. WebGL, in your theme, with no libraries.

  • BackgroundsPro

    Particle Logo

    Tens of thousands of particles form your word or logo, scatter from the pointer and spring back; a press sends a shock wave through them. A WebGL particle simulation in your theme colours, with no libraries.