ENVOEnvision DS
← Back to Home

Use Mobile

A mobile breakpoint detection hook.

Preview

Open in v0
use-mobileAuto

No dedicated preview is defined for this component yet. Add a custom entry in src/lib/component-previews.tsx to render a richer interactive demo.

Installation

External project (shadcn CLI). Merge the config into components.json, set ENVISION_REGISTRY_TOKEN, then run the add command. A raw /r/…json URL does not send the token.

Registry config

{ "registries": { "@envision-ds": { "url": "https://envision.envo.no/r/{name}.json", "headers": { "Authorization": "Bearer ${ENVISION_REGISTRY_TOKEN}" } } } }

Install command

npx shadcn@latest add @envision-ds/use-mobile

Internal monorepo import

import { UseMobile } from "@envo/envision-ds/use-mobile";

Usage

import { UseMobile } from "@envo/envision-ds/use-mobile"; export function Example() { return <UseMobile />; }