Animated border spotlight that travels around a rounded container edge.
Made by AxylExamples
Border Trail Loading Card
Border Trail Textarea
Installation
Usage
BorderTrail is a client component and decorative overlay. The parent must be relative with a matching border-radius (the trail inherits rounding via rounded-[inherit]).
When prefers-reduced-motion: reduce is set, the looping trail is replaced by a subtle static ring. Finite animations (e.g. the loading card) still call onAnimationComplete after the equivalent duration. See Accessibility.
Props
| Prop | Type | Default |
|---|---|---|
size? | number | 60 |
transition? | Transition | - |
onAnimationComplete? | () => void | - |
className? | string | "bg-zinc-500" |
style? | CSSProperties | - |
Credits
Inspired by motion-primitives Border Trail.
Built by Axyl. A motion-first component registry for React.
Last updated: 6/28/2026