Skip to content

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

Merged
jinho-yeom merged 2 commits into
magicuidesign:mainfrom
yashjaiswal2818:fix/reduced-motion-text-effects
Dec 1, 2026
Merged

jinho-yeom merged 2 commits into
magicuidesign:mainfrom
yashjaiswal2818:fix/reduced-motion-text-effects

Conversation

@yashjaiswal2818

@yashjaiswal2818 yashjaiswal2818 commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

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: also wrapped in <MotionConfig reducedMotion="user">, so the ring stays still. This covers a transition set inside custom variants too (thanks @jinho-yeom for catching that).
  • 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 uses MotionConfig for the same reason, and because a transition inside variants overrides one set on the component. SparklesText takes no variants or transition props, so it only needs useReducedMotion() to show still sparkles and skip its update interval.

Breaking Changes

None for default setups. One edge case: if an app sets its own <MotionConfig reducedMotion>, the inner "user" in WordRotate and SpinningText takes precedence inside those components.

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

@jinho-yeom jinho-yeom left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't SpinningText use <MotionConfig reducedMotion="user"> too, like WordRotate? A transition set inside variants still spins under reduced motion.

@yashjaiswal2818

Copy link
Copy Markdown
Contributor Author

good catch, you're right. a transition inside variants overrides the one on the component, so it kept spinning. i checked in chrome with reduced motion on: default, the transition prop and a variants transition all hold still now, and nothing changes without the setting. pushed the fix, SpinningText uses MotionConfig like WordRotate. left SparklesText on useReducedMotion since it doesn't take variants or transition props.

@jinho-yeom jinho-yeom left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yashjaiswal2818 Thanks for the quick fix and contribution!

@jinho-yeom
jinho-yeom merged commit 2ef6969 into magicuidesign:main Dec 1, 2026
7 of 8 checks passed
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.

2 participants