Skip to content

fix(registry): respect reduced motion in WordRotate, SpinningText and SparklesText - #1111

Open
yashjaiswal2818 wants to merge 1 commit into
magicuidesign:mainfrom
yashjaiswal2818:fix/reduced-motion-text-effects
Open

yashjaiswal2818 wants to merge 1 commit into
magicuidesign:mainfrom
yashjaiswal2818:fix/reduced-motion-text-effects

Conversation

@yashjaiswal2818

Copy link
Copy Markdown

Description

WordRotate, SpinningText and SparklesText animate continuously and ignore prefers-reduced-motion. This makes all three respect it. With reduced motion on, they still show their content, just without the movement. Without it, nothing changes.

Changes

  • WordRotate: wrapped in <MotionConfig reducedMotion="user">. With reduced motion, motion skips the slide and keeps the opacity fade, so words still change but don't move. This also covers custom motionProps.
  • SpinningText: with reduced motion the ring renders without spinning (useReducedMotion(), transition becomes { duration: 0 }).
  • SparklesText: with reduced motion the sparkles render still, and the 100ms interval that regenerates them doesn't start.
  • Ran pnpm build:registry and committed the generated files.

Motivation

These three loop forever and the OS setting can't stop them. Six components already respect reduced motion (DiaTextReveal, Dither, Floating3DParticles, IconCloud, RetroGrid, ScrollBasedVelocity), but these three didn't.

WordRotate uses MotionConfig instead of useReducedMotion() because the hook returns null on the server and the real value on the client. Changing WordRotate's initial from it caused a hydration mismatch, and the first word stayed stuck 50px up and out of view. MotionConfig applies at animation time, so the server and client render the same markup. SpinningText and SparklesText only change transition and the sparkles created in the effect, so the hook is safe there.

Breaking Changes

None for default setups. One edge case: if an app sets its own <MotionConfig reducedMotion>, WordRotate's inner "user" takes precedence inside that component.

Screenshots

This is a motion-only change, so I checked behavior instead of static screenshots. I loaded the three docs pages in Chrome with prefers-reduced-motion emulated on and off, and sampled the animated elements over time:

Device / Browser / Viewport: macOS, Chrome (headless), 1280×900

Component No preference Reduced motion
WordRotate slides, as before words change and fade in place, no slide
SpinningText spins, as before still ring
SparklesText sparkles animate, as before sparkles shown, still

There were no hydration or console errors on any of the three pages in either mode.

Checklist

  • pnpm check passes locally
  • pnpm build passes locally
  • pnpm build:registry was run and the generated files are committed
  • PR title follows Conventional Commits

@vercel

vercel Bot commented Nov 29, 2026

Copy link
Copy Markdown

@yashjaiswal2818 is attempting to deploy a commit to the product-studio Team on Vercel.

A member of the Team first needs to authorize it.

@jinho-yeom
jinho-yeom self-requested a review November 29, 2026 12:14

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant