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) 371 B
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react");exports.useModal=({defaultOpen:t=!1,onOpenChange:o}={})=>{const[s,a]=e.useState(t);return{isOpen:s,open:e.useCallback((()=>{a(!0),o?.(!0)}),[o]),close:e.useCallback((()=>{a(!1),o?.(!1)}),[o]),toggle:e.useCallback((()=>{a((e=>{const t=!e;return o?.(t),t}))}),[o])}};