BorderBeam
A soft rotating "border beam" shimmer used to draw attention to an element
before the user interacts with it.
Two usage shapes:
1. Wrapper - pass children and the beam wraps them in a relative box.
2. Overlay - render without children inside an existing relative parent.
Honours prefers-reduced-motion (renders nothing - a static ring would be
louder than the animated sweep it's meant to replace). When visible flips
to false, the beam fades out then unmounts so its rAF loop stops.
Usage
Best practices
Animate the
--border-beam-anglecustom property (as the source does), neverrotatethe masked ring - a rotated box swings its mask outside a wide pill's bounds and renders as a stray streak, not a border orbit.Requires
ReducedMotionProvider; under reduced motion it renders nothing (a static ring would read louder than the sweep it replaces), so don't add your own fallback border.Use it as an attention / "try me" cue on an idle surface, not a loading state - content placeholders want
Skeleton, and a periodic liveness flick wantsShine.
Props
Also exports
- interface
BorderBeamProps
Composition
Builds on