Border Beam
betaA short light that travels round the border of any button, card or field it sits in — always, or only on hover and focus.
- Effects & motion
- 1 file
- 1 npm package
- Accessibility notes
pnpm dlx @dowel-ui/cli add border-beamnpm packages installed: class-variance-authority.
import { BorderBeam } from "@/components/ui/border-beam";Default
Generate Button
On Hover
Pair
<BorderBeam>
| Prop | Type | Default |
|---|---|---|
colorThe colour of the beam's head, overriding | string | — |
colorToThe colour its tail fades through, overriding | string | — |
delayWait before the first trip, in milliseconds. Negative starts part-way round. Default 0. | number | 0 |
durationOne full trip round the border, in milliseconds. Default 6000. | number | 6000 |
glow | boolean | — |
lengthHow much of the border the beam covers, 0–1. Default 0.2. | number | 0.2 |
reverseTravel anticlockwise. | boolean | false |
thicknessWidth of the beam in pixels. Default 1 — the width of a hairline border. | number | 1 |
tone | "primary" | "foreground" | "info" | "success" | "warning" | "destructive" | "brand" | "primary" |
trigger
| "always" | "hover" | "always" |
Plus every attribute of <span> except children, color.
8/8
checks passed
- Tested — passes
- axe assertion — passes
- Keyboard tested — does not apply
- Storybook examples — passes
- Accessibility documented — passes
- Semantic tokens only — passes
- Motion from tokens — passes
- className merged — passes
- Visible focus — does not apply
- No fixed widths — passes