Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Living wiki of UI design patterns and best practices built with Fumadocs, Next.js, and Base UI components.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
rules/morphing-reduced-motion.md
1---2title: Reduced Motion Support for Icons3impact: MEDIUM4tags: morphing, a11y, reduced-motion5---67## Reduced Motion Support for Icons89Respect prefers-reduced-motion by disabling animations.1011**Incorrect (always animates):**1213```tsx14function MorphingIcon({ icon }: Props) {15return <motion.line animate={...} transition={{ duration: 0.4 }} />;16}17```1819**Correct (respects preference):**2021```tsx22function MorphingIcon({ icon }: Props) {23const reducedMotion = useReducedMotion() ?? false;24const activeTransition = reducedMotion ? { duration: 0 } : transition;2526return <motion.line animate={...} transition={activeTransition} />;27}28```29