BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/Azemmur/hooks-use-is-mobile

useIsMobile

azemmur/hooks-use-is-mobile
FreeHook

A hook to detect whether the current viewport is considered mobile.

Install it

npx shadcn@latest add https://azemmur.raouf.codes/r/hooks-use-is-mobile.json

Source

registry/hooks/use-is-mobile/index.tsazemmur.raouf.codes/r/hooks-use-is-mobile.json
1// Copyright (c) 2026 raouf.codes - Azemmur
2
3'use client';
4
5import { useState, useEffect } from 'react';
6
7const DEFAULT_BREAKPOINT = 1024;
8
9/**
10 * Hook to detect whether the current viewport is considered "mobile".
11 *
12 * Uses a resize listener to determine if the viewport width is below the breakpoint.
13 * Returns `undefined` during SSR, then `true` or `false` after hydration.
14 *
15 * @example
16 * ```tsx
17 * const isMobile = useIsMobile();
18 * if (isMobile) {
19 * // Render mobile layout
20 * }
21 * ```
22 *
23 * @param breakpoint - The width threshold in pixels (default: 1024)
24 * @returns `undefined` during SSR, `true` if mobile, `false` otherwise
25 */
26export function useIsMobile(breakpoint = DEFAULT_BREAKPOINT) {
27 const [isMobile, setIsMobile] = useState<boolean | undefined>(undefined);
28
29 useEffect(() => {
30 const checkScreenSize = () => {
31 setIsMobile(window.innerWidth < breakpoint);
32 };
33
34 checkScreenSize();
35 window.addEventListener('resize', checkScreenSize);
36
37 return () => {
38 window.removeEventListener('resize', checkScreenSize);
39 };
40 }, [breakpoint]);
41
42 return isMobile;
43}

Files it writes

  • registry/hooks/use-is-mobile/index.ts

Facts

Registry
Azemmur
Type
registry:hook
Access
Free
Files written
1
Licence
NOASSERTION
In the index
at or before 2026-08-07
Last confirmed
today

Go to the source

azemmur.raouf.codes Gattalraouf/azemmur-ui on GitHub Raw registry item This item as JSON

More from Azemmur

All 27 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
useFocusTraphooks-use-focus-trapAzemmurHooksFreeno deps
useKeyActionshooks-use-key-actionsAzemmurHooksFreeno deps
useMergeRefshooks-use-merged-refsAzemmurHooksFreeno deps
usePinchZoomhooks-use-pinch-zoomAzemmurHooksFreeno deps

Also from Kynth Studios

Built for the same person as BlockDex

SkillWorks

Claude Code skills and plugins, scored

skillworks.kynth.studio

RuleStack

AGENTS.md gallery and agent-config comparison

rulestack.kynth.studio

ToolDrift

What the AI coding tools changed last night

tooldrift.kynth.studio

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex