Simulates prefers-reduced-motion for the demo. Off follows your system setting.
Steps focus through the demo with ] and [. Tab, arrows, and Escape stay native so the component behaves as shipped.
1
Unlimited projects, priority support.
A liquid metal ring with a wandering halo for buttons, icons, text and badges.
npx shadcn@latest add ikislay/pixel-ui/metal-buttonimport { useRef } from "react"import { ArrowUp } from "lucide-react"import { MetalBadge, MetalButton, MetalText, useMetalBend } from "@/components/ui/metal-button"export function Demo() {const ref = useRef<HTMLDivElement>(null)useMetalBend(ref)return (<div className="flex items-center gap-6"><MetalButton preset="chromatic"><button className="rounded-full bg-black px-6 py-3 text-white">Upgrade to Pro</button></MetalButton><MetalButton ref={ref} variant="circle" innerShadow><button aria-label="Send" className="flex size-12 items-center justify-center rounded-full bg-black text-white">
1// Loading…
Options you can pass to customize this component.
presetchromaticsilvergoldThe metal. Each one has a dark and a light tuning.
variantbuttoncircleButton follows the child's corner radius; circle rounds the ring fully.
strengthnumberFrom 0 to 1. Scales the opacity of the metal and its glow.
themelightdarkPicks the preset's tuning. Left unset, it follows the page's text color.
innerShadowtruefalseAdds a light rim along the top inside edge of the ring.
reflectionTargetsRefObject<HTMLElement>[]Neighbouring elements that catch a light rim on the edge facing the metal. It sets their box-shadow.
disableGlowtruefalseTurns off the halo and the reflections.
glowGainnumberMultiplies the halo's brightness.
pausedtruefalseFreezes the flow. The cursor dent still works.
MetalText fontstringCSS font shorthand for the metal text, like "500 24px/1.2 Inter". Takes preset, theme, strength and paused too.
MetalText colorstringTints the metal text, and colors it when WebGL is missing.
useMetalBend(ref)RefObject<HTMLElement>Pass the ref you gave MetalButton to dent the ring under the cursor.
useMetalTextReflection(metalRef, textRef)RefObject<HTMLElement>Makes a text element catch the halo with a soft colored text shadow.