Liquid Metal
A moving metal ring drawn with WebGL, in chromatic, silver and gold.
Customize
Installation
npx shadcn@latest add https://fancyborders.vercel.app/r/frame-metal.jsonThe 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
import { FrameMetal } from "@/components/ui/frame-metal";| Prop | Type | Default |
|---|---|---|
| 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" |
| scale | numberSize of the pattern. 2 doubles it, 0.5 halves it. | 1 |
| speed | numberSpeed of the motion. 0.5 is half speed. | 1 |
| paused | booleanHold the metal still on its current frame. | false |
| thickness | number | stringLine width, when different from the frame's. | – |
| offset | number | stringDistance from the frame's edge. Positive is outward, negative inward. | 0 |
| radius | number | stringOverrides the frame's radius for this layer. | – |
Also accepts every div attribute, such as className and style.