shadcn.io is not affiliated with official shadcn/ui
Docs
Free
useIsMobile for React
Reports whether the viewport is below the mobile breakpoint.
useIsMobile says whether the viewport is narrower than 768px, and keeps the answer current as the window resizes.
It starts as false on the server and on the first render, then measures in an effect, so the server's HTML always matches. Try the demo at the phone width. For any other breakpoint or feature, use useMediaQuery.
Installation
Sign in to get your install command
Free with an account. It carries your token, so the CLI installs everything in one go.