Measured entry

motion-primitives-spotlight

hero-effectgradient-glowmotion on file

A client-side React spotlight that tracks the pointer with a spring-driven radial glow inside its parent. It ships as a shadcn registry component and depends on Motion, Tailwind utility classes, and the usual cn helper imported through the project alias.

Specimen
Motion capture of the mounted demo, recorded by the harness. No audio track.
Harness screenshot of motion-primitives-spotlight at 375 pixels wide
Harness screenshot at 375 pixels wide. No horizontal overflow recorded.
Harness screenshot of motion-primitives-spotlight at 768 pixels wide
Harness screenshot at 768 pixels wide. No horizontal overflow recorded.
Harness screenshot of motion-primitives-spotlight at 1440 pixels wide
Harness screenshot at 1440 pixels wide. No horizontal overflow recorded.

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.

Harness measurements recorded for motion-primitives-spotlight
BuildOK
MountOK
Console errors0
Uncaught page errors0
Horizontal overflowclean at 375, 768, 1440
Axe critical0
Axe serious0
Axe moderate0
Axe minor0
Gzip marginal67.8 KB (133.2 KB build, 65.4 KB baseline)
Bare modeFAIL
Provider requiredNO
Demo usedwritten from the component source API

What the harness recorded

BARE BUILD

✗ Build failed in 30.88s
error during build:
[vite:load-fallback] Could not load <sandbox>/src/lib/utils (imported by src/cut/spotlight.tsx): ENOENT: no such file or directory, open '<sandbox>/src/lib/utils'

Verdict

A focused, reliable decorative effect with clean mounting and no observed accessibility or overflow issues. It needs a shadcn-style setup out of the box because its utility helper alias is assumed, and the Motion dependency is substantial for a single glow.

Use it if

  • You want a pointer-following glow over a dark hero, card, or callout.
  • Your React app already uses Tailwind and Motion.
  • The containing element can safely become positioned with clipped overflow.

Skip it if

  • The effect must provide equal value on touch-only devices, where hover tracking does not apply.
  • The parent must preserve visible overflow or its existing positioning behavior.
  • You want a CSS-only accent without adding the Motion runtime.

Install

Installation record for motion-primitives-spotlight
Declared dependenciesmotion
Missing on installnone
Bare installfails once the shadcn-style helpers are removed, so it needs that setup
Providerno provider required in the harness

In a non-shadcn project, install Motion, configure Tailwind with the utilities used here, add a cn class-merging helper or replace that call, and map the project alias or change it to a local import. Render it from a client component.

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.

Alternatives

Other published entries for the hero-effect pattern, ordered by what they measured: mounts first, then clean axe scans, then bare-mode passes, then the smaller bundle.