Liquid Metal Button

Pill button with a flowing liquid chrome WebGL shader rim and click ripple.

Liquid Metal Button wraps a React pill button in a Three.js WebGL shader that flows around the rim like liquid chrome. Highlight lobes travel the border continuously, hovering and pressing speed up the flow, and clicks fire a ripple through the metal. The palette, lobe count, flow angle, and dispersion are all props, and the button falls back to a plain CSS rim when WebGL is unavailable. Use it for premium CTAs on AI and developer tool landing pages where the primary action deserves extra attention.

Installation

Usage

import { LiquidMetalButton } from "@/components/ui/liquid-metal-button";
<LiquidMetalButton onClick={() => console.log("clicked")}>
  Get Started
</LiquidMetalButton>

Icon-only: make it square and give it a label, since there is no text to read.

<LiquidMetalButton
  className="aspect-square w-12 px-0 py-0"
  aria-label="Get started"
>
  <Sparkles className="size-4" aria-hidden />
</LiquidMetalButton>

Recolour the rim by passing any subset of the palette:

<LiquidMetalButton
  colors={{ warm: "#ff6ec7", cool: "#7af0ff", highlight: "#f5f5ff" }}
>
  Get Started
</LiquidMetalButton>

The two tints are applied as brightness-preserving multipliers, so they shift the hue of the metal without lightening or darkening it — pass saturated colours and let chromaticShift control how strongly they read.

Props

Accepts every standard <button> attribute in addition to the below.

PropTypeDefaultDescription
childrenReactNode—Button content. Text, an icon, or both.
rimWidthnumber2Thickness of the visible metal rim, in pixels.
repetitionnumber2Number of highlight lobes travelling around the rim. Higher is busier.
softnessnumber0.3Edge falloff between lobes. Low values give crisp chrome edges.
chromaticShiftnumber0.6Strength of the amber/blue dispersion across the lit rim, 0 to 1.
bandingnumber0.92How hard the colour bands are edged. 0 blends gold into blue smoothly; 1 gives crisp stripes.
anglenumber45Flow direction, in degrees.
scalenumber3Zoom of the lateral wash across the rim.
speednumber1.8Base flow speed. Hover and press scale this up.
colorsobject—Palette of the rim: shadow, highlight, warm, cool as hex. Any omitted key keeps its default.
disableRipplebooleanfalseSuppress the click ripple.
surfaceClassNamestring—Classes for the inner pill that sits on top of the metal rim.
classNamestring—Classes for the button itself.