Edge Frame
A frame with a pattern cut into its edges: zigzag teeth, waves, scallops or the bites of a stamp.
scallop, 16px
Customize
Installation
npx shadcn@latest add https://fancyborders.vercel.app/r/edge-frame.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.
Examples
With effects
A gradient and a glow inside an edge frame take its outline.
Limited edition
A gradient on a scalloped edge.
Good to know
- Each edge fits a whole number of repeats, so the pattern never ends on half a tooth. Doing that needs the frame's size, so this is a client component that measures itself; before it has, and without JavaScript, it is a plain rectangle.
- Zigzags, waves and scallops stand on a line set in from the box by the depth. Give the frame at least that much padding on the patterned edges.
- It is still a shape frame, so effect layers follow the pattern.
API reference
EdgeFrame
import { EdgeFrame } from "@/components/edge-frame";| Prop | Type | Default |
|---|---|---|
| edge | "zigzag" | "wave" | "scallop" | "bite"The pattern cut into the edges: zigzag teeth, a wave, a scallop of round bumps, or round bites like the edge of a stamp. | "zigzag" |
| sides | ("top" | "right" | "bottom" | "left")[]Which edges get the pattern. | top and bottom |
| size | numberLength of one tooth, wave or bump, in pixels. Each edge fits a whole number of them, so the real length is the closest that divides it. | 16 |
| depth | numberHow far the pattern reaches in from the edge, in pixels. | 8 |
Also accepts line, fill, color and every div attribute.