# Liquid Metal

> Pour a flowing chrome surface into the container or into a circle or rounded rectangle.

Source: https://www.honestui.com/docs/shaders/liquid-metal

<ComponentPreview name="liquid-metal-demo" />

## Overview [#overview]

Liquid Metal renders a mirror-like surface that slowly flows, reflecting a simple studio of bright and dim light bands. Near the band edges a little color separates, the way light does through polished glass or mercury. Fill a whole container for a hero background, or set `shape` to pour the metal into a circle or rounded rectangle with a transparent outside: the reflections bend along the outline, so the shape reads as a solid, beveled object, which suits a product mark, an avatar ring, or an empty state.

Keep the default near-white `colorTint` for chrome, or tint it warm for gold and copper finishes. Fewer bands with more `softness` read as brushed metal; more bands with low softness read as polished chrome.

## Installation [#installation]

<CommandBlock commands="[&#x22;honestui&#x22;]" />

## Usage [#usage]

```tsx
import { LiquidMetal } from "honestui/shaders"

<div className="h-80 bg-neutral-950">
  <LiquidMetal className="size-full" shape="circle" shapeScale={0.7} />
</div>
```

With `shape="circle"` or `shape="rounded-rect"`, everything outside the shape is transparent, so the container's own background shows through.

## Accessibility [#accessibility]

Liquid Metal is decorative: the canvas is hidden from assistive technology, and any text or action belongs in normal HTML beside or above it. The bright bands move across the whole surface, so test the contrast of overlaid text across the full animation, not one frame. The effect pauses while it is offscreen, while the document is hidden, and when the user prefers reduced motion; a still frame is rendered instead. Use `paused` for your own control, and give the container a background that stands in when WebGL is unavailable.

## API Reference [#api-reference]


  ### `colorTint`

type: `string` · default: `&#x22;#f4f5f7&#x22;`

Color multiplied into the reflections. Near white reads as chrome; warm tints read as gold or copper.

  ### `repetition`

type: `number` · default: `4`

Number of reflected light bands across the surface.

  ### `softness`

type: `number` · default: `0.25`

Softness of the band edges, from 0 (mirror sharp) to 1 (brushed).

  ### `distortion`

type: `number` · default: `1`

How strongly the surface ripples and flows. 0 gives flat, straight bands.

  ### `dispersion`

type: `number` · default: `0.35`

Color separation along the band edges.

  ### `angle`

type: `number` · default: `70`

Direction of the reflected bands, in degrees.

  ### `speed`

type: `number` · default: `0.6`

Animation speed. Changing it never makes the surface jump.

  ### `shape`

type: `&#x22;none&#x22; | &#x22;circle&#x22; | &#x22;rounded-rect&#x22;` · default: `&#x22;none&#x22;`

Fill the container, or pour the metal into a shape with a transparent outside.

  ### `shapeScale`

type: `number` · default: `0.72`

Size of the shape relative to the container, from 0 to 1.

  ### `paused`

type: `boolean` · default: `false`

Renders a static frame instead of animating.

  ### `className`

type: `string`

Class for sizing and positioning the container.
