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

React
TypeScript
Tailwind CSS

Detected package dependencies: metal-fx.

@spectrumui/metal-button

One shared WebGL shader paints every ring — chromatic, silver and gold presets.

Installation

Login to view commandCreate a free account to access the install command

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.

PropTypeDefaultDescription
preset"chromatic" | "silver" | "gold""chromatic"Metal palette
theme"auto" | "dark" | "light""auto"auto follows a .dark/.light class on <html>, then the OS preference
strengthnumber1Ring intensity from 0 to 1
size"sm" | "md" | "lg""md"Pill height and type size
pausedbooleanfalseFreeze the shader on its current frame
classNamestring-Classes for the inner button
wrapperClassNamestring-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.

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.

Work with me