Components / Effects

Spotlight

Borders that light up near the pointer, across every frame on the page at once.

A1

A2

A3

B1

B2

B3

Customize

Light radius
140px
Radius
10px
Colour
Wash the surface

Installation

npx shadcn@latest add https://fancyborders.vercel.app/r/frame-spotlight.json

The 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 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";
PropTypeDefault
colorsstring[]

Colour of the light, or two colours for its centre and its edge.

the text colour
sizenumber | string

Radius of the light.

220
washboolean | number

Also wash the frame's surface with the light. A number is the wash's strength; true is 0.08.

false
thicknessnumber | string

Line width, when different from the frame's.

–
offsetnumber | string

Distance from the frame's edge. Positive is outward, negative inward.

0
radiusnumber | string

Overrides the frame's radius for this layer.

–

Also accepts every div attribute, such as className and style.