Components / Effects

Liquid Metal

A moving metal ring drawn with WebGL, in chromatic, silver and gold.

Upgrade to Pro

Customize

Finish
Line
2px
Radius
24px
Pattern size
1×
Speed
1×
Paused

Installation

npx shadcn@latest add https://fancyborders.vercel.app/r/frame-metal.json

The CLI copies the component into your project, adds anything it is built on, and writes its CSS into your global stylesheet. New to the CLI? See Installation.

Good to know

  • Every metal layer on the page shares one WebGL context and one animation loop, and layers scrolled out of view are skipped.
  • The metal is laid over the frame's ordinary line colour and is see-through where it has nothing to add, so the frame keeps a continuous edge. Without WebGL that plain line is all there is.
  • This is a client component. The shader is adapted from metal-fx by Jakub Antalik, under the MIT License.

API reference

FrameMetal

tsx
import { FrameMetal } from "@/components/ui/frame-metal";
PropTypeDefault
preset"chromatic" | "silver" | "gold"

The finish.

"chromatic"
theme"dark" | "light" | "auto"

Which palette to use: the one tuned for dark surfaces or for light ones. auto follows the page's color-scheme (set by most theme switchers), and the system's when the page sets none.

"auto"
scalenumber

Size of the pattern. 2 doubles it, 0.5 halves it.

1
speednumber

Speed of the motion. 0.5 is half speed.

1
pausedboolean

Hold the metal still on its current frame.

false
thicknessnumber | string

Line width, when different from the frame's.

–
offsetnumber | string

Distance from the frame's edge. Positive is outward, negative inward.

0
radiusnumber | string

Overrides the frame's radius for this layer.

–

Also accepts every div attribute, such as className and style.