Liquid Chrome Button
A circular WebGL liquid-metal button with a frosted glass lens, springy hover response, and anchor support.
Installation#
pnpm dlx shadcn@latest add @davinciui/liquid-chrome-buttonUsage#
API Reference#
| Prop | Type | Default |
|---|---|---|
sizeButton diameter, clamped from 40 to 300px. | number | 112 |
borderWidthWidth of the animated chrome ring in pixels. | number | 10 |
speedWebGL liquid-motion multiplier. Use 0 for a static surface. | number | 1 |
glassOpacityOpacity of the frosted inner lens, from 0 to 1. | number | 0.42 |
iconOptional built-in center icon. | "folder" | "lightning" | "cursor" | — |
customIconCustom SVG or React content, automatically contained in the glass lens. | ReactNode | — |
hrefRenders an anchor when supplied; otherwise renders a button. | string | — |
Accessibility#
Renders a native button or anchor with a default 'Liquid chrome button' label, so Enter and Space work and focus-visible shows a ring. Pass a descriptive ariaLabel; decorative mode is aria-hidden and non-interactive. The WebGL canvas is hidden from assistive tech.
Motion#
The WebGL chrome ring animates continuously and speed scales its motion; speed 0 freezes it. Rendering pauses offscreen, and prefers-reduced-motion stops the loop on a static frame. The 300ms hover and press scale is disabled under motion-reduce.
View source
Keep in mind
Need a custom component?
I build bespoke UI components & websites tailored to your brand.

