tigran tumasov

useBreakpoints

Component

About

A React hook that provides responsive breakpoints

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds useBreakpoints to your project and fits it to your theme.

Code

How useBreakpoints is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

import useBreakpoints from "@/components/ui/use-breakpoints";

export default function DefaultDemo() {
  const { isMobile, isDesktop } = useBreakpoints();

  return (
    <div>
      {isMobile && <div>Mobile</div>}
      {isDesktop && <div>Desktop</div>}
    </div>
  );
}

More by tigran tumasov

View all
  • Product Hunt Badge

    Product Hunt Badge

    1.8K
  • Book

    Book

    162
  • Calendar

    Calendar

    152
  • Theme Switcher

    Theme Switcher

    135
  • Snippet

    Snippet

    124
  • Table

    Table

    123
  • Toggle

    Toggle

    89
  • Feedback

    Feedback

    88

Explore more

Part of Geist — browse the full library on 21st.dev.