A growing collection of practical, production-ready React hooks built with modern React and Node.js in mind.
No magic. No hidden behavior. Just sharp, composable hooks you actually reuse.
⚠️ Active development
hookstackis under constant improvement. New hooks and enhancements are added regularly. APIs aim to be stable, but minor refinements may happen as the library evolves.
Most hook libraries fall into one of two traps:
- too small to be useful
- too opinionated to be safe
hookstack stays in the middle.
- Focused, reusable hooks
- No unnecessary dependencies
- SSR-safe by default
- Typed with TypeScript
- Works with modern React (18+)
- Built for real-world apps, not demos
If a hook starts behaving like a framework feature, it doesn’t belong here.
npm install hookstack
# or
pnpm add hookstack
# or
yarn add hookstackAll hooks are exported from the root package.
import { useToggle, useLocalStorage, useFetch } from 'hookstack';No deep imports. No internal paths.
-
useToggle
Manage boolean state with clearon,off, andtogglehelpers. -
useLocalStorage
Persist state inlocalStoragewith SSR safety and JSON handling. -
useCookie
Read, write, and remove browser cookies with explicit options. -
useCopyToClipboard
Copy text to the clipboard with status tracking and safe fallbacks. -
useFetch
Perform simple, abort-safe HTTP requests with manual or automatic execution.
-
Primitives first Hooks should do one thing well.
-
No fake abstractions If a hook hides important behavior, it’s wrong.
-
SSR-safe by default Hooks should not crash during server rendering.
-
Escape hatches included Manual control beats clever automation.
hookstack deliberately does not include:
useAuthuseFormuseAxiosuseQueryreplacements- App-specific hooks
Those belong in your application, not a shared library.
Planned and in-progress hooks include:
useEventuseIntervaluseDebouncedValueuseMediaQueryuseClickOutsideusePrevioususeDisclosure
The library is actively evolving, with careful API additions over time.
Contributions are welcome, but discipline matters.
- Hooks must be reusable
- No app-specific assumptions
- Simplicity over cleverness
Open an issue before large changes.
MIT © Gautam Suthar