{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "use-reduced-motion",
  "title": "Use Reduced Motion",
  "description": "Reads the reduced-motion query and re-reads it when the setting changes, for the effects CSS cannot switch off.",
  "files": [
    {
      "path": "registry/terminal/hooks/use-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 query = window.matchMedia(QUERY);\n  query.addEventListener(\"change\", onChange);\n  return () => query.removeEventListener(\"change\", onChange);\n}\n\nfunction getSnapshot(): boolean {\n  return window.matchMedia(QUERY).matches;\n}\n\nfunction getServerSnapshot(): boolean {\n  return false;\n}\n\nfunction useReducedMotion(): boolean {\n  return useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);\n}\n\nexport { useReducedMotion };\n",
      "type": "registry:hook"
    }
  ],
  "categories": [
    "effects"
  ],
  "type": "registry:hook"
}