Liquid Metal Button

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

Liquid Metal Button wraps a React pill button in a WebGL2 shader rim of flowing liquid chrome, with a thin gold and blue fringe on its edges. Hover and press speed up the flow, clicks fire a ripple, and it falls back to a plain CSS rim when WebGL2 is unavailable. Use it for premium CTAs on AI and developer tool landing pages.

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>

Tune the metal: more stripes, a wider prism fringe, a little liquid wobble:

<LiquidMetalButton
  repetition={6}
  shiftRed={0.8}
  shiftBlue={0.8}
  distortion={0.4}
>
  Get Started
</LiquidMetalButton>

Set shiftRed and shiftBlue to 0 for plain polished steel with no fringe.

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.
repetitionnumber4How many stripes of light fit across the metal.
softnessnumber0.50 is a hard edge between light and dark, 1 a smooth gradient.
shiftRednumber0.3How far red is pulled ahead of green: the warm side of the prism fringe.
shiftBluenumber0.3How far blue is pulled behind green: the cool side of the prism fringe.
distortionnumber0Noise bending the stripes. 0 keeps them smooth arcs.
anglenumber45Direction the stripes run and flow, in degrees.
scalenumber8How far zoomed in. Higher shows a smaller window of the pattern, so broader bands.
speednumber0.6Base flow speed. Hover runs at 1.7×, and a press at 4× for 300ms.
disableRipplebooleanfalseSuppress the click ripple.
surfaceClassNamestring—Classes for the inner pill that sits on top of the metal rim.
classNamestring—Classes for the button itself.