{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "use-prefers-reduced-motion",
  "title": "usePrefersReducedMotion",
  "description": "Hydration-safe hook that reports the user's reduced-motion preference and updates when it changes.",
  "dependencies": [],
  "devDependencies": [],
  "registryDependencies": [],
  "files": [
    {
      "path": "hooks/use-prefers-reduced-motion.ts",
      "content": "\"use client\"\n\nimport { useSyncExternalStore } from \"react\"\n\nconst QUERY = \"(prefers-reduced-motion: reduce)\"\n\nfunction subscribe(onChange: () => void) {\n  const media = window.matchMedia(QUERY)\n  media.addEventListener(\"change\", onChange)\n  return () => {\n    media.removeEventListener(\"change\", onChange)\n  }\n}\n\nconst getSnapshot = () => window.matchMedia(QUERY).matches\nconst getServerSnapshot = () => false\n\n/**\n * `true` when the user asked the OS for reduced motion. Hydration-safe: it\n * reports `false` while hydrating, then updates, so components can render a\n * different structure for reduced motion without hydration mismatches.\n */\nexport function usePrefersReducedMotion() {\n  return useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot)\n}\n",
      "type": "registry:hook"
    }
  ],
  "meta": {
    "tier": "free",
    "collection": "interface",
    "needsImage": false,
    "addedAt": "2026-10-12",
    "tags": [
      "hook",
      "reduced-motion",
      "accessibility"
    ],
    "tech": [],
    "presets": [],
    "keyboard": [],
    "heavy": false
  },
  "categories": [
    "internal"
  ],
  "type": "registry:hook"
}