shadcn.io is not affiliated with official shadcn/ui
Liquid chrome fills the box: a polished metal sheet whose soft swells roll slowly, each with a bright band of light on its shoulder and a white highlight on its crest, while a broad streak of light sweeps across now and then. On a light page it's bright silver; on a dark one, graphite with cool highlights. Each of the two sheets is an SVG height field of smooth noise run through a chrome curve, the way polished metal reflects a sky and a horizon, then coloured in your theme; the browser draws it once, and CSS keyframes drift the two sheets in opposite directions, the second laid over the first, so their reflections meet and part. Only transforms animate, and no script runs.
Use it behind a product or launch page that wants a chrome, futuristic surface. For an iridescent foil, use Hologram; for a flowing satin sheen, Silk; for viscous blobs that merge and split, Metaballs; for veined stone made the same way, Marble.
Installation
Usage
import { Mercury } from "@/components/ui/mercury";<Mercury className="flex min-h-[480px] items-center justify-center">
<h1 className="text-5xl font-semibold">Liquid metal</h1>
</Mercury>Mercury is a container: whatever you put inside sits on top of the metal, in normal flow. It covers its own box edge to edge, so give it a height or content. The swells keep their size whatever the box, so a card shows a few and a full page many. For a backdrop behind the whole page, render it empty with className="fixed inset-0 -z-10".
Demos
Tint
tintColor colours the metal and keeps its light and shade, here gold. Any CSS colour works: a pale blue gives titanium, a rose gives copper.
Ripples
rippleScale sets the size of the swells: 2 gives a tight, disturbed surface and 0.6 a broad, still pool. intensity="subtle" lets more of the page through, so a card you put on top stays calm.
Accessibility
The metal is decoration: it's hidden from assistive tech and lets every click through to your content. With reduced motion the sheets hold still and the streak is hidden, so a still chrome surface stays. Nothing flashes: the streak is soft and crosses once every 13 seconds.
Put copy over it in your foreground colour (text-foreground). The metal's tones are kept in a range text can sit on: at the default intensity the foreground colour keeps about 6.4:1 on a light page and 4.5:1 on a dark one over the content area at the worst frame. intensity="strong" deepens the troughs and brightens the crests; check small text against it.
FAQ
How is the chrome look made?
A smooth noise field runs through a chrome curve: as the surface rises, the metal goes from shade to a bright band, back down and up to a white highlight, so every swell catches light on its shoulder and crest, as polished metal reflects its surroundings. A touch of fine grain before the curve keeps its gradients free of banding.
Does it run JavaScript or a canvas every frame?
No. The browser draws the two SVG sheets once, when the background first shows, and after that CSS keyframes slide and turn them on the compositor. They never scale, so they're never drawn again.
What does rippleScale do?
It sets the size of the swells: 1 by default, 0.6 for a broad, still pool and 2 for a tight, disturbed surface, from 0.4 to 3. It changes the texture itself, so nothing is stretched.
Can I make it gold or titanium?
Yes. tintColor colours the metal and keeps its light and shade, on both themes. highlightColor sets the colour of the highlights and the streak, white by default.
API Reference
Mercury
<div> data-slot="mercury"
highlightColor?string
The colour of the highlights and the sweeping streak, any CSS colour.
- Default
"white"
intensity?"subtle" | "medium" | "strong"
How strongly the metal shows over the surface: subtle behind body
text, strong for a full chrome sheet.
- Type
"subtle" | "medium" | "strong"- Default
"medium"
rippleScale?number
The size of the swells: 0.6 gives a broad, still pool, 2 a tight, disturbed surface.
- Default
1
speed?number
How fast the metal rolls and the streak sweeps: 2 is twice as fast, 0.5 half as fast.
- Default
1
tintColor?string
The metal's colour, any CSS colour, such as gold or titanium; left out, a cool silver (graphite on a dark page).
render?ReactElement | ((props: object, state: object) => ReactElement)
Replace the host element or compose it with another component.
- Type
ReactElement | ((props: object, state: object) => ReactElement)
className?string
Merged with the part's classes.
--mercury-highlightstring
The highlights' colour (white).
--mercury-speedstring
The motion's speed, a multiplier (1).
--mercury-tintstring
The metal's colour (a cool silver).
Related
- Pro


Metaballs Background
GradientsViscous blobs that merge and split
- Pro


Silk Background
GradientsA flowing satin sheen
- Pro


Hologram Background
GradientsAn iridescent foil sweep
- Pro


Marble Background
TextureTurbulence veins, the same SVG technique
- Pro


Caustics Background
WavesA moving net of light on water
- Pro


Ocean Background
WavesA reflective sea surface with glitter