Spotlight
Borders that light up near the pointer, across every frame on the page at once.
A1
A2
A3
B1
B2
B3
Customize
Light radius140px
Radius10px
Colour
Wash the surface
Installation
npx shadcn@latest add https://fancyborders.vercel.app/r/frame-spotlight.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.
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 |
|---|---|---|
| colors | string[]Colour of the light, or two colours for its centre and its edge. | the text colour |
| size | number | stringRadius of the light. | 220 |
| wash | boolean | numberAlso wash the frame's surface with the light. A number is the wash's strength; true is 0.08. | false |
| thickness | number | stringLine width, when different from the frame's. | – |
| offset | number | stringDistance from the frame's edge. Positive is outward, negative inward. | 0 |
| radius | number | stringOverrides the frame's radius for this layer. | – |
Also accepts every div attribute, such as className and style.