Repository navigation
0.1.1
Tag: v0.1.0
Title: useThisHook v0.1.0
Body:
useThisHook v0.1.0
First public release of useThisHook — a typed, tree-shakeable set of React hooks for everyday UI, forms, lists, overlays, and browser APIs.
Install
npm install usethishook
Peer dependency: React 18+ (React 19 supported). Named exports only.
Docs
[Playground (Vercel)](https://usethishook.mentorbridge.in/)
[Playground (GitHub Pages)](https://senthilkumar979.github.io/useThisHook/)
[npm: usethishook](https://www.npmjs.com/package/usethishook)
What's included
State
useToggle — boolean with toggle, setTrue, setFalse
useCounter — increment, decrement, reset
useDisclosure — open / close / toggle for menus and dialogs
useDebounce — debounce a rapidly changing value
usePrevious — previous render's value
useInterval — declarative setInterval (null pauses)
useCopyToClipboard — clipboard write + last copied text
useLocalStorage — JSON state persisted in localStorage
useDocumentTitle — set document.title while mounted
Browser
useOnlineStatus — navigator.onLine plus online/offline events
useMediaQuery — subscribe to a CSS media query
useWindowSize — viewport width and height
useOnClickOutside — handler when the user presses outside a ref
useOverlay — promise-based custom overlay
useStepFlow — multi-step wizard that resolves when finished
useAsyncSelect — native file picker as a Promise
App
useStableCallback — stable function identity, always-latest body
useOnChange — callback when a value changes, not on mount
useResetState — local state that resets when a source key changes
useAsyncAction — pending / error / data around one async action
useDebouncedCallback — debounce calling a function
useFields — small form object, optional Zod-shaped schema
useList — insert, update, remove, reorder by id
useSelection — single or multi select ids
useSearchState — URL search params as React state
useConfirm — await a yes/no dialog
usePrompt — await a string from a dialog
useControllableState — controlled and uncontrolled in one setter
useUnsavedChanges — tab-close warning and in-app leave confirm
useElementSize — element size via ResizeObserver
useInView — element vs viewport via IntersectionObserver
usePagination — page, offset, next/prev with clamping
Confirm, prompt, and overlay hooks return a render() function — mount it once in the tree.
useFields accepts an optional Zod-shaped safeParse schema. Zod is not a package dependency.
Package
ESM + CJS + generated TypeScript types
MIT License
Author: [Senthil Kumar Thangavel](https://senthilkumar.mentorbridge.in/)