>` | `"bevel"` | Corner treatment: "square", "round", "bevel", "notch" or "scoop". One for every corner, or an object with one per corner. |
| `corners` | `("tl" \| "tr" \| "br" \| "bl")[]` | `all four` | Limits a single corner treatment to these corners. |
| `size` | `number` | `12` | Size of the corner treatment, in pixels. |
| `line` | `number` | `1` | Line width, in pixels. |
| `punch` | `{ sides?, at?, radius? }` | – | Semicircular bites out of the edges: which sides (left and right by default), where along the edge (the middle), and their radius (8). |
| `fill` | `string` | – | Background painted inside the shape. Any CSS background works. |
| `path` | `ShapePath` | – | A ready-made outline from polygonPaths, in place of the corners and the punch. |
Also accepts every Frame prop except radius, and every div attribute.
---
# Ticket Frame
> A ticket with rounded corners, a perforated line and a tear-off stub.
- Category: Shapes (Outlines that are not rectangles, with borders that follow them.)
- Registry item: `ticket-frame`
- Live preview with controls: https://fancyborders.vercel.app/docs/components/ticket-frame
## Installation
```bash
npx shadcn@latest add https://fancyborders.vercel.app/r/ticket-frame.json
```
With the registry namespace: `npx shadcn@latest add @fancyborders/ticket-frame`.
The CLI also adds what `ticket-frame` is built on: `frame`, `shape-frame`.
Files it adds: `components/ui/frame.tsx`, `components/ui/shape-frame.tsx`, `components/ticket-frame.tsx`, and its CSS goes into the global stylesheet after the Tailwind import.
## Usage
The code for the preview at its default settings:
```tsx
import { TicketFrame } from "@/components/ticket-frame";
}
fill="var(--background)"
className="drop-shadow-md"
>
Your content
```
## Good to know
- Use a drop-shadow filter rather than box-shadow for a shadow that follows the bites in every browser.
## API reference
### TicketFrame
```tsx
import { TicketFrame } from "@/components/ticket-frame";
```
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `stub` | `ReactNode` | – | Content of the tear-off stub on the right. Required. |
| `stubWidth` | `number` | `112` | Width of the stub, in pixels. |
| `punchRadius` | `number` | `9` | Radius of the bites at the top and bottom of the perforation. |
| `radius` | `number` | `12` | Radius of the outer corners. |
Also accepts line, fill, color and every div attribute.
---
# Folder Frame
> A folder with a tab on its top edge and a sloping shoulder down to the body.
- Category: Shapes (Outlines that are not rectangles, with borders that follow them.)
- Registry item: `folder-frame`
- Live preview with controls: https://fancyborders.vercel.app/docs/components/folder-frame
## Installation
```bash
npx shadcn@latest add https://fancyborders.vercel.app/r/folder-frame.json
```
With the registry namespace: `npx shadcn@latest add @fancyborders/folder-frame`.
The CLI also adds what `folder-frame` is built on: `frame`, `shape-frame`.
Files it adds: `components/ui/frame.tsx`, `components/ui/shape-frame.tsx`, `components/folder-frame.tsx`, and its CSS goes into the global stylesheet after the Tailwind import.
## Usage
The code for the preview at its default settings:
```tsx
import { FolderFrame } from "@/components/folder-frame";
Your content
```
## Good to know
- The tab's content goes in the tab prop. The children start below the tab, so pad them rather than the frame.
- The outline is a plain polygon, so the border, fill and drop-shadow follow it in every browser.
## API reference
### FolderFrame
```tsx
import { FolderFrame } from "@/components/folder-frame";
```
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `tab` | `ReactNode` | – | Content of the tab, such as a label. |
| `tabSide` | `"left" \| "right"` | `"left"` | Which end of the top edge the tab sits on. |
| `tabWidth` | `number` | `112` | Width of the tab's top edge, in pixels. |
| `tabHeight` | `number` | `28` | Height of the tab, in pixels. |
| `slope` | `number` | `14` | How far the tab's shoulder runs sideways on its way down, in pixels. |
| `radius` | `number` | `10` | Radius of the corners, in pixels. |
Also accepts line, fill, color and every div attribute.
---
# Speech Bubble
> A rounded box with a tail on any edge. The border runs around the tail unbroken.
- Category: Shapes (Outlines that are not rectangles, with borders that follow them.)
- Registry item: `bubble-frame`
- Live preview with controls: https://fancyborders.vercel.app/docs/components/speech-bubble
## Installation
```bash
npx shadcn@latest add https://fancyborders.vercel.app/r/bubble-frame.json
```
With the registry namespace: `npx shadcn@latest add @fancyborders/bubble-frame`.
The CLI also adds what `bubble-frame` is built on: `frame`, `shape-frame`.
Files it adds: `components/ui/frame.tsx`, `components/ui/shape-frame.tsx`, `components/bubble-frame.tsx`, and its CSS goes into the global stylesheet after the Tailwind import.
## Usage
The code for the preview at its default settings:
```tsx
import { BubbleFrame } from "@/components/bubble-frame";
Shipped it.
```
## Examples
### A conversation
Tails on opposite sides, each a fixed distance from its own end.
```tsx
import { BubbleFrame } from "@/components/bubble-frame";
export default function BubbleChat() {
return (
Is the new border live?
Deployed a minute ago.
It goes all the way round the tail!
);
}
```
## Good to know
- The tail is drawn inside the frame's box, and the content is kept clear of it, so a bubble takes the room its box says it does.
- A negative at counts from the far end of the edge, which keeps the tail a fixed distance from the right or the bottom.
## API reference
### BubbleFrame
```tsx
import { BubbleFrame } from "@/components/bubble-frame";
```
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `side` | `"top" \| "right" \| "bottom" \| "left"` | `"bottom"` | The edge the tail points out of. |
| `at` | `number \| `${number}%`` | `28` | Where the tail sits along its edge: pixels from the left or top, pixels from the other end when negative, or a percentage. |
| `tailSize` | `number` | `10` | How far the tail sticks out, in pixels. |
| `tailWidth` | `number` | `16` | Width of the tail where it joins the bubble, in pixels. |
| `lean` | `number` | `0` | How far the tip leans along the edge, in pixels. Negative leans back. |
| `radius` | `number` | `14` | Radius of the corners, in pixels. |
Also accepts line, fill, color and every div attribute.
---
# Edge Frame
> A frame with a pattern cut into its edges: zigzag teeth, waves, scallops or the bites of a stamp.
- Category: Shapes (Outlines that are not rectangles, with borders that follow them.)
- Registry item: `edge-frame`
- Live preview with controls: https://fancyborders.vercel.app/docs/components/edge-frame
## Installation
```bash
npx shadcn@latest add https://fancyborders.vercel.app/r/edge-frame.json
```
With the registry namespace: `npx shadcn@latest add @fancyborders/edge-frame`.
The CLI also adds what `edge-frame` is built on: `frame`, `shape-frame`.
Files it adds: `components/ui/frame.tsx`, `components/ui/shape-frame.tsx`, `components/edge-frame.tsx`, and its CSS goes into the global stylesheet after the Tailwind import.
## Usage
The code for the preview at its default settings:
```tsx
import { EdgeFrame } from "@/components/edge-frame";
Content
```
## Examples
### With effects
A gradient and a glow inside an edge frame take its outline.
```tsx
import { EdgeFrame } from "@/components/edge-frame";
import { FrameGlow, FrameGradient } from "@/components/ui/frame-effects";
export default function EdgeEffects() {
return (
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
```tsx
import { EdgeFrame } from "@/components/edge-frame";
```
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `edge` | `"zigzag" \| "wave" \| "scallop" \| "bite"` | `"zigzag"` | The pattern cut into the edges: zigzag teeth, a wave, a scallop of round bumps, or round bites like the edge of a stamp. |
| `sides` | `("top" \| "right" \| "bottom" \| "left")[]` | `top and bottom` | Which edges get the pattern. |
| `size` | `number` | `16` | Length 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. |
| `depth` | `number` | `8` | How far the pattern reaches in from the edge, in pixels. |
Also accepts line, fill, color and every div attribute.
---
# Receipt
> A slip of paper torn off along a zigzag edge.
- Category: Shapes (Outlines that are not rectangles, with borders that follow them.)
- Registry item: `edge-frame` — Receipt is a recipe: a few layers of `edge-frame` put together, not an item of its own. Install `edge-frame` and copy the code below.
- Live preview with controls: https://fancyborders.vercel.app/docs/components/receipt
## Installation
```bash
npx shadcn@latest add https://fancyborders.vercel.app/r/edge-frame.json
```
With the registry namespace: `npx shadcn@latest add @fancyborders/edge-frame`.
The CLI also adds what `edge-frame` is built on: `frame`, `shape-frame`.
Files it adds: `components/ui/frame.tsx`, `components/ui/shape-frame.tsx`, `components/edge-frame.tsx`, and its CSS goes into the global stylesheet after the Tailwind import.
## Usage
The code for the preview at its default settings:
```tsx
import { EdgeFrame } from "@/components/edge-frame";
Your receipt
```
## API reference
### EdgeFrame
```tsx
import { EdgeFrame } from "@/components/edge-frame";
```
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `edge` | `"zigzag" \| "wave" \| "scallop" \| "bite"` | `"zigzag"` | The pattern cut into the edges: zigzag teeth, a wave, a scallop of round bumps, or round bites like the edge of a stamp. |
| `sides` | `("top" \| "right" \| "bottom" \| "left")[]` | `top and bottom` | Which edges get the pattern. |
| `size` | `number` | `16` | Length 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. |
| `depth` | `number` | `8` | How far the pattern reaches in from the edge, in pixels. |
Also accepts line, fill, color and every div attribute.
---
# Stamp
> A postage stamp: round bites out of all four edges.
- Category: Shapes (Outlines that are not rectangles, with borders that follow them.)
- Registry item: `edge-frame` — Stamp is a recipe: a few layers of `edge-frame` put together, not an item of its own. Install `edge-frame` and copy the code below.
- Live preview with controls: https://fancyborders.vercel.app/docs/components/stamp
## Installation
```bash
npx shadcn@latest add https://fancyborders.vercel.app/r/edge-frame.json
```
With the registry namespace: `npx shadcn@latest add @fancyborders/edge-frame`.
The CLI also adds what `edge-frame` is built on: `frame`, `shape-frame`.
Files it adds: `components/ui/frame.tsx`, `components/ui/shape-frame.tsx`, `components/edge-frame.tsx`, and its CSS goes into the global stylesheet after the Tailwind import.
## Usage
The code for the preview at its default settings:
```tsx
import { EdgeFrame } from "@/components/edge-frame";
Your picture
```
## API reference
### EdgeFrame
```tsx
import { EdgeFrame } from "@/components/edge-frame";
```
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `edge` | `"zigzag" \| "wave" \| "scallop" \| "bite"` | `"zigzag"` | The pattern cut into the edges: zigzag teeth, a wave, a scallop of round bumps, or round bites like the edge of a stamp. |
| `sides` | `("top" \| "right" \| "bottom" \| "left")[]` | `top and bottom` | Which edges get the pattern. |
| `size` | `number` | `16` | Length 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. |
| `depth` | `number` | `8` | How far the pattern reaches in from the edge, in pixels. |
Also accepts line, fill, color and every div attribute.
---
# Dash Patterns
> Dashed lines with the dash and the gap set independently, which a CSS border cannot do.
- Category: Lines (Line styles for any frame: dashes, native styles and motion.)
- Registry item: `frame` — Dash Patterns is a recipe: a few layers of `frame` put together, not an item of its own. Install `frame` and copy the code below.
- Live preview with controls: https://fancyborders.vercel.app/docs/components/dash-patterns
## Installation
```bash
npx shadcn@latest add https://fancyborders.vercel.app/r/frame.json
```
With the registry namespace: `npx shadcn@latest add @fancyborders/frame`.
Files it adds: `components/ui/frame.tsx`, and its CSS goes into the global stylesheet after the Tailwind import.
## Usage
The code for the preview at its default settings:
```tsx
import { Frame, FrameRules } from "@/components/ui/frame";
Content
```
## Good to know
- Rules are four straight lines, so they ignore the radius. For a dashed line that follows rounded corners use FrameBorder with the dashed variant.
## API reference
### FrameRules
```tsx
import { FrameRules } from "@/components/ui/frame";
```
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `sides` | `("top" \| "right" \| "bottom" \| "left")[]` | `all four` | Which sides get a line. |
| `overshoot` | `number \| string \| { x?, y? }` | `0` | How far the lines run past the corners. x extends the horizontal lines, y the vertical ones. |
| `dash` | `number \| string` | `4` | Dash length. Setting dash or gap makes the lines dashed. |
| `gap` | `number \| string` | `4` | Space between dashes. |
| `march` | `boolean \| number` | `false` | Make the dashes travel clockwise. A number is the seconds a dash takes to reach the next one's place; true is 0.6. |
| `offset` | `number \| string` | `0` | Distance from the frame's edge. Positive is outward, negative inward. |
| `color` | `string` | – | Overrides the frame's line colour for this layer. |
Also accepts every div attribute, such as className and style.
---
# Border Styles
> Solid, dashed, dotted and double borders that follow the radius and can sit inside or outside the frame's edge.
- Category: Lines (Line styles for any frame: dashes, native styles and motion.)
- Registry item: `frame` — Border Styles is a recipe: a few layers of `frame` put together, not an item of its own. Install `frame` and copy the code below.
- Live preview with controls: https://fancyborders.vercel.app/docs/components/border-styles
## Installation
```bash
npx shadcn@latest add https://fancyborders.vercel.app/r/frame.json
```
With the registry namespace: `npx shadcn@latest add @fancyborders/frame`.
Files it adds: `components/ui/frame.tsx`, and its CSS goes into the global stylesheet after the Tailwind import.
## Usage
The code for the preview at its default settings:
```tsx
import { Frame, FrameBorder } from "@/components/ui/frame";
Content
```
## Good to know
- A double border needs a line at least 3 pixels wide to show both lines.
## API reference
### FrameBorder
```tsx
import { FrameBorder } from "@/components/ui/frame";
```
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `variant` | `"solid" \| "dashed" \| "dotted" \| "double"` | `"solid"` | The CSS border style. |
| `offset` | `number \| string` | `0` | Distance from the frame's edge. Positive is outward, negative inward. |
| `radius` | `number \| string` | – | Overrides the frame's radius for this layer. |
| `color` | `string` | – | Overrides the frame's line colour for this layer. |
Also accepts every div attribute, such as className and style.
---
# Marching Ants
> Dashed rules whose dashes travel around the frame, like a selection rectangle.
- Category: Lines (Line styles for any frame: dashes, native styles and motion.)
- Registry item: `frame` — Marching Ants is a recipe: a few layers of `frame` put together, not an item of its own. Install `frame` and copy the code below.
- Live preview with controls: https://fancyborders.vercel.app/docs/components/marching-ants
## Installation
```bash
npx shadcn@latest add https://fancyborders.vercel.app/r/frame.json
```
With the registry namespace: `npx shadcn@latest add @fancyborders/frame`.
Files it adds: `components/ui/frame.tsx`, and its CSS goes into the global stylesheet after the Tailwind import.
## Usage
The code for the preview at its default settings:
```tsx
import { Frame, FrameCorners, FrameRules } from "@/components/ui/frame";
Content
```
## Good to know
- The dashes stand still for people who ask for reduced motion.
## API reference
### FrameRules
```tsx
import { FrameRules } from "@/components/ui/frame";
```
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `sides` | `("top" \| "right" \| "bottom" \| "left")[]` | `all four` | Which sides get a line. |
| `overshoot` | `number \| string \| { x?, y? }` | `0` | How far the lines run past the corners. x extends the horizontal lines, y the vertical ones. |
| `dash` | `number \| string` | `4` | Dash length. Setting dash or gap makes the lines dashed. |
| `gap` | `number \| string` | `4` | Space between dashes. |
| `march` | `boolean \| number` | `false` | Make the dashes travel clockwise. A number is the seconds a dash takes to reach the next one's place; true is 0.6. |
| `offset` | `number \| string` | `0` | Distance from the frame's edge. Positive is outward, negative inward. |
| `color` | `string` | – | Overrides the frame's line colour for this layer. |
Also accepts every div attribute, such as className and style.
---
# Beam
> A light that travels the border at a steady speed, around any proportions and any corner.
- Category: Effects (Gradient, glow and moving light, as more layers for a frame.)
- Registry item: `beam-frame`
- Live preview with controls: https://fancyborders.vercel.app/docs/components/beam
## Installation
```bash
npx shadcn@latest add https://fancyborders.vercel.app/r/beam-frame.json
```
With the registry namespace: `npx shadcn@latest add @fancyborders/beam-frame`.
The CLI also adds what `beam-frame` is built on: `frame`, `frame-effects`.
Files it adds: `components/ui/frame.tsx`, `components/ui/frame-effects.tsx`, `components/beam-frame.tsx`, and its CSS goes into the global stylesheet after the Tailwind import.
## Usage
The code for the preview at its default settings:
```tsx
import { BeamFrame } from "@/components/beam-frame";
Your content
```
## Examples
### On a shape
Inside a shape frame the beam follows the shape's outline.
```tsx
import { FrameBeam } from "@/components/ui/frame-effects";
import { ShapeFrame } from "@/components/ui/shape-frame";
export default function BeamShape() {
return (
Around a notched frame
);
}
```
### Coloured by utilities
Leave out the colours and the beam reads frame-from-* and frame-to-* from the frame.
```tsx
import { BeamFrame } from "@/components/beam-frame";
export default function BeamUtilities() {
return (
frame-from-slate-400
);
}
```
## Good to know
- BeamFrame is a preset: a Frame with a FrameBorder and a FrameBeam. Use the FrameBeam layer directly, from frame-effects, to add a beam to any frame.
- The beam follows the outline with offset-path, which needs Chromium 116, Firefox 122 or Safari 18. Without it nothing is drawn and the plain border remains.
## API reference
### BeamFrame
```tsx
import { BeamFrame } from "@/components/beam-frame";
```
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `colors` | `string[]` | – | The beam's colours: the first for its head, the last for its tail. |
| `size` | `number \| string` | `120` | Length of the beam. |
| `duration` | `number \| string` | `6` | Time for one lap of the frame. Numbers are seconds. |
| `count` | `number` | `1` | Number of beams, spaced evenly around the frame. |
| `reverse` | `boolean` | `false` | Travel anticlockwise. |
Also accepts every Frame prop and every div attribute.
### FrameBeam
```tsx
import { FrameBeam } from "@/components/ui/frame-effects";
```
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `colors` | `string[]` | – | The beam's colours: the first for its head, the last for its tail. Without them it reads frame-from-* and frame-to-*. |
| `size` | `number \| string` | `120` | Length of the beam. |
| `duration` | `number \| string` | `6` | Time for one lap of the frame. Numbers are seconds. |
| `count` | `number` | `1` | Number of beams, spaced evenly around the frame. |
| `reverse` | `boolean` | `false` | Travel anticlockwise. |
| `bloom` | `number \| false` | `0.25` | Strength of the light the beam casts on either side of the line. false leaves only the line. |
| `thickness` | `number \| string` | – | Line width, when different from the frame's. |
| `offset` | `number \| string` | `0` | Distance from the frame's edge. Positive is outward, negative inward. |
| `radius` | `number \| string` | – | Overrides the frame's radius for this layer. |
Also accepts every div attribute, such as className and style.
---
# Glow
> A gradient border with a halo of the same colours glowing behind it, still or turning.
- Category: Effects (Gradient, glow and moving light, as more layers for a frame.)
- Registry item: `glow-frame`
- Live preview with controls: https://fancyborders.vercel.app/docs/components/glow
## Installation
```bash
npx shadcn@latest add https://fancyborders.vercel.app/r/glow-frame.json
```
With the registry namespace: `npx shadcn@latest add @fancyborders/glow-frame`.
The CLI also adds what `glow-frame` is built on: `frame`, `frame-effects`.
Files it adds: `components/ui/frame.tsx`, `components/ui/frame-effects.tsx`, `components/glow-frame.tsx`, and its CSS goes into the global stylesheet after the Tailwind import.
## Usage
The code for the preview at its default settings:
```tsx
import { GlowFrame } from "@/components/glow-frame";
Your content
```
## Examples
### On a shape
Inside a shape frame the halo is the whole shape blurred behind it, so give the shape a fill.
```tsx
import { FrameGlow, FrameGradient } from "@/components/ui/frame-effects";
import { ShapeFrame } from "@/components/ui/shape-frame";
export default function GlowShape() {
return (
Gradient and glow
);
}
```
## Good to know
- GlowFrame is a preset: a Frame with a FrameGlow and a FrameGradient that share their colours. Both layers come from frame-effects.
- The halo is painted behind the frame's content but in front of the frame's own background.
## API reference
### GlowFrame
```tsx
import { GlowFrame } from "@/components/glow-frame";
```
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `colors` | `string[]` | – | Colour stops shared by the border and the halo. |
| `spin` | `boolean \| number` | `false` | Turn the colours around the frame. A number is the seconds one turn takes. |
| `pulse` | `boolean \| number` | `false` | Make the halo breathe. A number is the seconds one breath in takes. |
| `blur` | `number \| string` | `10` | Blur radius of the halo. |
| `spread` | `number \| string` | `14` | Width of the band that is blurred. Wider is brighter. |
Also accepts every Frame prop and every div attribute.
### FrameGlow
```tsx
import { FrameGlow } from "@/components/ui/frame-effects";
```
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `colors` | `string[]` | – | Colour stops, in order. Without them the layer reads the frame-from-*, frame-via-* and frame-to-* utilities. |
| `gradient` | `string` | – | Any CSS image, in place of the gradient built from the colours. |
| `angle` | `number \| string` | `135` | Direction of the gradient. Numbers are degrees. |
| `spin` | `boolean \| number` | `false` | Turn the gradient around the frame. A number is the seconds one turn takes; true is 4. |
| `pulse` | `boolean \| number` | `false` | Breathe in and out. A number is the seconds one breath in takes; true is 2.4. |
| `blur` | `number \| string` | `10` | Blur radius of the halo. |
| `spread` | `number \| string` | `14` | Width of the band that is blurred. Wider is brighter. |
| `opacity` | `number` | `0.75` | Strength of the halo, from 0 to 1. |
| `offset` | `number \| string` | `0` | Distance from the frame's edge. Positive is outward, negative inward. |
| `radius` | `number \| string` | – | Overrides the frame's radius for this layer. |
Also accepts every div attribute, such as className and style.
---
# Gradient
> A gradient drawn on the frame's line, in any colours and at any angle, optionally turning around the frame.
- Category: Effects (Gradient, glow and moving light, as more layers for a frame.)
- Registry item: `frame-effects`
- Live preview with controls: https://fancyborders.vercel.app/docs/components/gradient
## Installation
```bash
npx shadcn@latest add https://fancyborders.vercel.app/r/frame-effects.json
```
With the registry namespace: `npx shadcn@latest add @fancyborders/frame-effects`.
The CLI also adds what `frame-effects` is built on: `frame`.
Files it adds: `components/ui/frame.tsx`, `components/ui/frame-effects.tsx`, and its CSS goes into the global stylesheet after the Tailwind import.
## Usage
The code for the preview at its default settings:
```tsx
import { Frame } from "@/components/ui/frame";
import { FrameGradient } from "@/components/ui/frame-effects";
Your content
```
## Examples
### Coloured by utilities
frame-from-*, frame-via-* and frame-to-* on the frame colour every effect layer inside it.
```tsx
import { Frame } from "@/components/ui/frame";
import { FrameGradient } from "@/components/ui/frame-effects";
export default function GradientUtilities() {
return (
frame-via-indigo-300
);
}
```
### A turning comet
Fade the gradient to transparent and spin it for a light that sweeps the border.
```tsx
import { Frame, FrameBorder, FrameCorners } from "@/components/ui/frame";
import { FrameGradient } from "@/components/ui/frame-effects";
export default function GradientComet() {
return (
spin
);
}
```
## API reference
### FrameGradient
```tsx
import { FrameGradient } from "@/components/ui/frame-effects";
```
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `colors` | `string[]` | – | Colour stops, in order. Without them the layer reads the frame-from-*, frame-via-* and frame-to-* utilities. |
| `gradient` | `string` | – | Any CSS image, in place of the gradient built from the colours. |
| `angle` | `number \| string` | `135` | Direction of the gradient. Numbers are degrees. |
| `spin` | `boolean \| number` | `false` | Turn the gradient around the frame. A number is the seconds one turn takes; true is 4. |
| `thickness` | `number \| string` | – | Line width, when different from the frame's. |
| `offset` | `number \| string` | `0` | Distance from the frame's edge. Positive is outward, negative inward. |
| `radius` | `number \| string` | – | Overrides the frame's radius for this layer. |
Also accepts every div attribute, such as className and style.
---
# Pulse
> A halo that breathes in and out, for something that is live, recording or waiting.
- Category: Effects (Gradient, glow and moving light, as more layers for a frame.)
- Registry item: `frame-effects` — Pulse is a recipe: a few layers of `frame-effects` put together, not an item of its own. Install `frame-effects` and copy the code below.
- Live preview with controls: https://fancyborders.vercel.app/docs/components/pulse
## Installation
```bash
npx shadcn@latest add https://fancyborders.vercel.app/r/frame-effects.json
```
With the registry namespace: `npx shadcn@latest add @fancyborders/frame-effects`.
The CLI also adds what `frame-effects` is built on: `frame`.
Files it adds: `components/ui/frame.tsx`, `components/ui/frame-effects.tsx`, and its CSS goes into the global stylesheet after the Tailwind import.
## Usage
The code for the preview at its default settings:
```tsx
import { Frame } from "@/components/ui/frame";
import {
FrameGlow,
FrameGradient,
} from "@/components/ui/frame-effects";
Recording
```
## Good to know
- The halo holds still for people who ask for reduced motion.
## API reference
### FrameGlow
```tsx
import { FrameGlow } from "@/components/ui/frame-effects";
```
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `colors` | `string[]` | – | Colour stops, in order. Without them the layer reads the frame-from-*, frame-via-* and frame-to-* utilities. |
| `gradient` | `string` | – | Any CSS image, in place of the gradient built from the colours. |
| `angle` | `number \| string` | `135` | Direction of the gradient. Numbers are degrees. |
| `spin` | `boolean \| number` | `false` | Turn the gradient around the frame. A number is the seconds one turn takes; true is 4. |
| `pulse` | `boolean \| number` | `false` | Breathe in and out. A number is the seconds one breath in takes; true is 2.4. |
| `blur` | `number \| string` | `10` | Blur radius of the halo. |
| `spread` | `number \| string` | `14` | Width of the band that is blurred. Wider is brighter. |
| `opacity` | `number` | `0.75` | Strength of the halo, from 0 to 1. |
| `offset` | `number \| string` | `0` | Distance from the frame's edge. Positive is outward, negative inward. |
| `radius` | `number \| string` | – | Overrides the frame's radius for this layer. |
Also accepts every div attribute, such as className and style.
### FrameGradient
```tsx
import { FrameGradient } from "@/components/ui/frame-effects";
```
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `colors` | `string[]` | – | Colour stops, in order. Without them the layer reads the frame-from-*, frame-via-* and frame-to-* utilities. |
| `gradient` | `string` | – | Any CSS image, in place of the gradient built from the colours. |
| `angle` | `number \| string` | `135` | Direction of the gradient. Numbers are degrees. |
| `spin` | `boolean \| number` | `false` | Turn the gradient around the frame. A number is the seconds one turn takes; true is 4. |
| `thickness` | `number \| string` | – | Line width, when different from the frame's. |
| `offset` | `number \| string` | `0` | Distance from the frame's edge. Positive is outward, negative inward. |
| `radius` | `number \| string` | – | Overrides the frame's radius for this layer. |
Also accepts every div attribute, such as className and style.
---
# Spotlight
> Borders that light up near the pointer, across every frame on the page at once.
- Category: Effects (Gradient, glow and moving light, as more layers for a frame.)
- Registry item: `frame-spotlight`
- Live preview with controls: https://fancyborders.vercel.app/docs/components/spotlight
## Installation
```bash
npx shadcn@latest add https://fancyborders.vercel.app/r/frame-spotlight.json
```
With the registry namespace: `npx shadcn@latest add @fancyborders/frame-spotlight`.
The CLI also adds what `frame-spotlight` is built on: `frame`.
Files it adds: `components/ui/frame.tsx`, `components/ui/frame-spotlight.tsx`, and its CSS goes into the global stylesheet after the Tailwind import.
## Usage
The code for the preview at its default settings:
```tsx
import { Frame, FrameBorder } from "@/components/ui/frame";
import { FrameSpotlight } from "@/components/ui/frame-spotlight";
Your content
```
## Good to know
- Every spotlight on the page shares one pointer listener, and updates at most once a frame.
- This is a client component. Put it over a faint FrameBorder so the frame keeps an edge where the light does not reach.
## API reference
### FrameSpotlight
```tsx
import { FrameSpotlight } from "@/components/ui/frame-spotlight";
```
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `colors` | `string[]` | `the text colour` | Colour of the light, or two colours for its centre and its edge. |
| `size` | `number \| string` | `220` | Radius of the light. |
| `wash` | `boolean \| number` | `false` | Also wash the frame's surface with the light. A number is the wash's strength; true is 0.08. |
| `thickness` | `number \| string` | – | Line width, when different from the frame's. |
| `offset` | `number \| string` | `0` | Distance from the frame's edge. Positive is outward, negative inward. |
| `radius` | `number \| string` | – | Overrides the frame's radius for this layer. |
Also accepts every div attribute, such as className and style.
---
# Liquid Metal
> A moving metal ring drawn with WebGL, in chromatic, silver and gold.
- Category: Effects (Gradient, glow and moving light, as more layers for a frame.)
- Registry item: `frame-metal`
- Live preview with controls: https://fancyborders.vercel.app/docs/components/liquid-metal
## Installation
```bash
npx shadcn@latest add https://fancyborders.vercel.app/r/frame-metal.json
```
With the registry namespace: `npx shadcn@latest add @fancyborders/frame-metal`.
The CLI also adds what `frame-metal` is built on: `frame`.
Files it adds: `components/ui/frame.tsx`, `components/ui/frame-metal.tsx`, and its CSS goes into the global stylesheet after the Tailwind import.
## Usage
The code for the preview at its default settings:
```tsx
import { Frame } from "@/components/ui/frame";
import { FrameMetal } from "@/components/ui/frame-metal";
Upgrade to Pro
```
## 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";
```
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `preset` | `"chromatic" \| "silver" \| "gold"` | `"chromatic"` | The finish. |
| `theme` | `"dark" \| "light" \| "auto"` | `"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. |
| `scale` | `number` | `1` | Size of the pattern. 2 doubles it, 0.5 halves it. |
| `speed` | `number` | `1` | Speed of the motion. 0.5 is half speed. |
| `paused` | `boolean` | `false` | Hold the metal still on its current frame. |
| `thickness` | `number \| string` | – | Line width, when different from the frame's. |
| `offset` | `number \| string` | `0` | Distance from the frame's edge. Positive is outward, negative inward. |
| `radius` | `number \| string` | – | Overrides the frame's radius for this layer. |
Also accepts every div attribute, such as className and style.