MCPcopy Create free account
hub / github.com/codeaashu/claude-code / useReducedMotion

Function useReducedMotion

web/hooks/useReducedMotion.ts:13–27  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

11 * <div className={reducedMotion ? "" : "animate-fade-in"}>...</div>
12 */
13export function useReducedMotion(): boolean {
14 const [reducedMotion, setReducedMotion] = useState(() => {
15 if (typeof window === "undefined") return false;
16 return window.matchMedia("(prefers-reduced-motion: reduce)").matches;
17 });
18
19 useEffect(() => {
20 const mq = window.matchMedia("(prefers-reduced-motion: reduce)");
21 const handler = (e: MediaQueryListEvent) => setReducedMotion(e.matches);
22 mq.addEventListener("change", handler);
23 return () => mq.removeEventListener("change", handler);
24 }, []);
25
26 return reducedMotion;
27}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected