Home / File/ use-mobile.json — ui Source File

use-mobile.json — ui Source File

Architecture documentation for use-mobile.json, a json file in the ui codebase.

Entity Profile

Source Code

{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "use-mobile",
  "files": [
    {
      "path": "registry/new-york-v4/hooks/use-mobile.ts",
      "content": "import * as React from \"react\"\n\nconst MOBILE_BREAKPOINT = 768\n\nexport function useIsMobile() {\n  const [isMobile, setIsMobile] = React.useState<boolean | undefined>(undefined)\n\n  React.useEffect(() => {\n    const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`)\n    const onChange = () => {\n      setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)\n    }\n    mql.addEventListener(\"change\", onChange)\n    setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)\n    return () => mql.removeEventListener(\"change\", onChange)\n  }, [])\n\n  return !!isMobile\n}\n",
      "type": "registry:hook"
    }
  ],
  "type": "registry:hook"
}

Frequently Asked Questions

What does use-mobile.json do?
use-mobile.json is a source file in the ui codebase, written in json.
Where is use-mobile.json in the architecture?
use-mobile.json is located at apps/v4/public/r/styles/new-york-v4/use-mobile.json (directory: apps/v4/public/r/styles/new-york-v4).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free