Metal Button
Overview
A pill button framed by a real-time WebGL liquid-metal ring, in chromatic, silver and gold presets.
This action component is intended for interfaces that need a pill button framed by a real-time WebGL liquid-metal ring, in chromatic, silver and gold presets, SaaS workflows, and onboarding flows. Its implementation is provided as editable source so the final behavior and styling stay inside your project.
Technologies
Detected package dependencies: metal-fx.
One shared WebGL shader paints every ring — chromatic, silver and gold presets.
Installation
Usage
import { MetalButton } from "@/components/spectrumui/metal-button"<MetalButton preset="gold" size="lg">Upgrade to Pro</MetalButton>
API Reference
MetalButton
Wraps a native button in MetalFx from the metal-fx package (Jakub Antalík, MIT). One shared WebGL shader paints every ring on the page, pauses offscreen and renders a transparent placeholder on the server. All native button attributes pass through.
| Prop | Type | Default | Description |
|---|---|---|---|
preset | "chromatic" | "silver" | "gold" | "chromatic" | Metal palette |
theme | "auto" | "dark" | "light" | "auto" | auto follows a .dark/.light class on <html>, then the OS preference |
strength | number | 1 | Ring intensity from 0 to 1 |
size | "sm" | "md" | "lg" | "md" | Pill height and type size |
paused | boolean | false | Freeze the shader on its current frame |
className | string | - | Classes for the inner button |
wrapperClassName | string | - | Classes for the MetalFx wrapper |
Use cases
- interfaces that need a pill button framed by a real-time WebGL liquid-metal ring, in chromatic, silver and gold presets
- SaaS workflows
- onboarding flows
Features
- Copy-paste source that remains in your repository
- TypeScript source included with the component
- Tailwind CSS classes editable in the component source
- Spectrum UI registry dependencies: @spectrumui/use-surface-theme
- Responsive Tailwind variants present in the source
Accessibility
- Test focus order, keyboard operation, labels, contrast, and screen-reader output in the final application context.
Customization
- Edit the Tailwind utility classes in the copied source to match your spacing, color, and typography tokens.
- Use the documented className surface for local layout adjustments, then edit the source for structural changes.
Related components
Metal Button FAQ
Is Metal Button free to use in commercial projects?
Yes. The public Metal Button source is available under the Apache License 2.0, including for commercial use, subject to the LICENSE terms.
How do I install Metal Button?
Run npx shadcn@latest add @spectrumui/metal-button. The page also exposes the source for manual installation.
Does Metal Button require Motion?
No Motion dependency was detected in the documented source or registry entry for Metal Button.
Does Metal Button use shadcn/ui or Radix UI?
No shadcn/ui or Radix UI dependency was detected in the documented Metal Button source.
Can I use Metal Button in Next.js?
The documented React source is used in this Next.js application. Keep its use client directive when copying it into the App Router. Install the detected dependencies and verify any application-specific data or image configuration.
What accessibility checks should I run for Metal Button?
No component-specific accessibility mechanism was detected automatically. Test keyboard operation, focus, labels, contrast, and screen-reader output before shipping.