Skip to Content

Engraved

Engraved metal texture: a seeded contour pattern over a metal gradient, traced in thin lines, in a range of metals. Apply it to a surface you already have for a coin or banknote look.

Installation

pnpm dlx shadcn@latest add @01orbital/engraved

Usage

import { Engraved } from "@/components/texture/engraved"

// Every word on the page. Change copy here, not in the markup.
const COPY = { graphite: "Graphite", silver: "Silver", gold: "Gold" } as const

// Three metals, each with its own seed, laid under a label.
export default function EngravedDemo() {
  return (
    <div className="flex min-h-full w-full flex-1 items-center justify-center p-6">
      <div className="grid w-full max-w-3xl gap-4 sm:grid-cols-3">
        {(["graphite", "silver", "gold"] as const).map((metal) => (
          <div
            key={metal}
            className="relative grid aspect-4/3 content-end rounded-xl p-6 shadow-md"
          >
            <Engraved from={`plate-${metal}`} metal={metal} />
            <span className="relative text-lg font-medium text-white text-shadow-legible">
              {COPY[metal]}
            </span>
          </div>
        ))}
      </div>
    </div>
  )
}

This example installs with everything it uses:

pnpm dlx shadcn@latest add @01orbital/engraved-demo

Examples

Goldengraved-gold

Engraved Gold: an example of engraved.

pnpm dlx shadcn@latest add @01orbital/engraved-gold

Lilacengraved-lilac

Engraved Lilac: an example of engraved.

pnpm dlx shadcn@latest add @01orbital/engraved-lilac

API reference

Engraved metal for a surface you already have: a seeded contour pattern over a metal gradient, traced in thin lines. Place it inside a relative parent, before the content; it fills the parent, follows its corner radius and is hidden from assistive tech. The pattern is painted on a canvas in the browser after it mounts.

Prop

Type

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

Dependencies

npm: cn. The CLI installs it for you.

Requires these pieces. The CLI adds each one that is missing and won't replace a file you already have unless you choose to:

Used in blocks

3 blocks are built with Engraved:

Last updated on