Measured entry
motion-primitives-border-trail
hover-effectgradient-glowmotion on file
A client-side React overlay that sends a colored block around the border of a positioned container. It ships as a shadcn registry TypeScript component and uses Motion for the path animation, Tailwind utility classes, CSS masking and offset-path, plus a cn helper backed by clsx and tailwind-merge.



Measured
Every value below was written by the harness on the run that produced the frames above. None of it is derived from the prose.
| Build | OK |
|---|---|
| Mount | OK |
| Console errors | 0 |
| Uncaught page errors | 0 |
| Horizontal overflow | clean at 375, 768, 1440 |
| Axe critical | 0 |
| Axe serious | 0 |
| Axe moderate | 0 |
| Axe minor | 0 |
| Gzip marginal | 70.0 KB (135.5 KB build, 65.5 KB baseline) |
| Bare mode | OK |
| Provider required | NO |
| Demo used | written from the component source API |
Verdict
A focused, reliable accent that built and mounted cleanly across the tested layouts without accessibility findings or overflow. The animation dependency is a meaningful cost for one decorative effect, and reduced-motion behavior is left to the adopter.
Use it if
- You want a looping edge highlight for cards, status panels, or active jobs.
- Your interface already uses Motion and Tailwind, so the component fits the existing stack.
- You need a decorative overlay that does not intercept pointer input or add accessible content.
Skip it if
- You only need a static border and do not want to ship an animation dependency for decoration.
- Your browser support policy excludes CSS masking or offset-path behavior.
- Continuous ambient motion would conflict with your product's reduced-motion policy unless you add that handling.
Install
| Declared dependencies | motion, clsx, tailwind-merge |
|---|---|
| Missing on install | none |
| Bare install | builds and mounts without the shadcn-style helpers |
| Provider | no provider required in the harness |
In a non-shadcn project, add Motion, clsx, and tailwind-merge, provide the cn class-merging helper, and ensure Tailwind processes the component classes. The host element must establish positioning, and clipping is recommended when the trail should stay within rounded edges. Add reduced-motion handling if your application requires it.
Source and credit
This page is a review, not a copy. The component source lives with its author and this site does not republish it. Read the license before you use anything.
Author repository
github.com/ibelick/motion-primitivesAlternatives
Other published entries for the hover-effect pattern, ordered by what they measured: mounts first, then clean axe scans, then bare-mode passes, then the smaller bundle.
- eldora-card-flip-hover3d
- Renders
- YES
- A11y
- 0
- Gzip
- 17.5KB
- Bare
- pass
- Prov
- NO
- uilayouts-btn-hover-left-flip3d
- Renders
- YES
- A11y
- 0
- Gzip
- 17.5KB
- Bare
- pass
- Prov
- NO
- uilayouts-btn-hover-down3d
- Renders
- YES
- A11y
- 0
- Gzip
- 17.6KB
- Bare
- pass
- Prov
- NO
- uilayouts-btn-hover-multiplegradient-glow
- Renders
- YES
- A11y
- 0
- Gzip
- 17.9KB
- Bare
- pass
- Prov
- NO
- magicui-cool-modespatial
- Renders
- YES
- A11y
- 0
- Gzip
- 21.8KB
- Bare
- pass
- Prov
- NO
- uilayouts-hovercard2gradient-glow
- Renders
- YES
- A11y
- 0
- Gzip
- 24.0KB
- Bare
- pass
- Prov
- NO