Mercury

No dependencies
Code format

Install with shadcn

Needs a free account token. Get a token

npx shadcn@latest add @movin/button-mercury

About this component

A bar of liquid chrome drawn by a WebGL shader: a dark photo studio's softbox and strip light wrap round its capsule in clean black and white, and slow swells bend the reflections. Hover and the metal rises in a bead under your pointer and follows it; press flattens the bead, it springs back, and a ripple rings out through the bar.

Triggers

  • Hover
  • Click
  • Mouse tracking
  • Continuous

Techniques

  • requestAnimationFrame
  • Event position
  • Gradient

Difficulty

Advanced

Accessibility

Keyboard and screen readers

A native <button> named by its label, Upgrade; the shader canvas is aria-hidden and the CSS gradient stands in until WebGL draws, or for good where it is unavailable. A key press ripples from the middle.

Reduced motion

The shader draws one still frame and the bead and ripple are off.

Use it in anything you build, commercial and client work included. Licence

More buttons

See all
PiñataGet code
SlotGet code
Soap filmGet code
SprayGet code