Use mobile

GitHub

React hook that reports whether the viewport is narrower than the mobile breakpoint.

Installation

bash
pnpm dlx shadcn@latest add @cs/use-mobile

Usage

tsx
import { useIsMobile } from "@/hooks/cs/use-mobile";
tsx
const isMobile = useIsMobile();

API Reference

useIsMobile

Reports whether the viewport is narrower than the mobile breakpoint.