UNPKG

nextuiq

Version:

NextUIQ is a modern, lightweight, and developer-friendly UI component library for React and Next.js. Built with TypeScript and Tailwind CSS, it offers customizable, accessible, and performance-optimized components with built-in dark mode, theme customizat

2 lines (1 loc) 700 B
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),n=1024;exports.useBreakpoint=()=>{const[i,t]=e.useState("undefined"!=typeof window?window.innerWidth:0),[o,d]=e.useState("undefined"!=typeof window?window.innerHeight:0);return e.useEffect((()=>{const e=()=>{t(window.innerWidth),d(window.innerHeight)};return"undefined"!=typeof window&&(window.addEventListener("resize",e),e()),()=>{"undefined"!=typeof window&&window.removeEventListener("resize",e)}}),[]),{breakpoint:i>=1536?"2xl":i>=1280?"xl":i>=n?"lg":i>=768?"md":i>=640?"sm":"xs",isMobile:i<768,isTablet:i>=768&&i<n,isDesktop:i>=n,width:i,height:o,orientation:i>o?"landscape":"portrait"}};