Border Beam
ProA beam of light that travels around the border of any element.
Installation
pnpm dlx shadcn@latest add @viewport/border-beam
First time? Add the @viewport registry to components.json. Setup takes one minute.
Usage
The code behind the preview above comes with Truffle Pro.
Props
| Prop | Type | Default |
|---|---|---|
| size | numberLength of the beam in pixels. | 120 |
| duration | numberSeconds for one lap. | 7 |
| delay | numberSeconds to offset the start. Use to stagger multiple beams. | 0 |
| colorFrom | string | "var(--brand)" |
| colorTo | string | "var(--brand-3)" |
| width | numberBorder thickness in pixels. | 1.5 |
| className | string | — |
Accessibility
- Decorative and aria-hidden.
- Hidden under reduced motion.
- Uses CSS offset-path; no JavaScript.