Skip to Content

Metal Surface

A metal surface component.

Installation

pnpm dlx shadcn@latest add @01orbital/metal-surface

Usage

import {
  MetalCoin,
  MetalSurface,
  sweep,
  type Metal,
} from "@/components/card/metal-surface"

const METALS: Metal[] = ["graphite", "silver", "gold", "bronze", "platinum"]

export default function Demo() {
  return (
    <div className="grid w-full place-items-center">
      <div className="flex flex-col items-center gap-8">
        <MetalSurface
          metal="gold"
          radius={18}
          className="aspect-[1.586] w-80"
          innerClassName="flex flex-col justify-between p-6"
        >
          <span className="text-[15px] font-semibold tracking-tight">
            Orbcore
          </span>
          <span className="text-5xl leading-none font-medium tracking-tighter tabular-nums">
            $100
          </span>
        </MetalSurface>
        <div className="flex gap-3">
          {METALS.map((m, i) => (
            <MetalCoin
              key={m}
              metal={m}
              size={44}
              reeded
              at={sweep("top-right", i, 0, METALS.length, 1)}
            />
          ))}
        </div>
      </div>
    </div>
  )
}

This example installs with everything it uses:

pnpm dlx shadcn@latest add @01orbital/metal-surface-demo

Anatomy

Metal Surface is built from 3 parts. In the example they nest like this:

MetalSurface
MetalCoin

API reference

MetalSurface

Prop

Type

MetalCoin

Prop

Type

It also accepts the HTML attributes of the element it renders.

MetalCoinEdge

Prop

Type

Dependencies

npm: cn. The CLI installs it for you.

Used in blocks

25 blocks are built with Metal Surface; the first 12:

Last updated on