Zero-dependency React hooks, ready to ship.
hookli.
Every hook you rewrite — typed, SSR-safe, zero dependencies.
npm i hookli- 65 typed hooks
- Zero dependencies
- SSR-safe
- ESM + CJS
Built for the hooks you copy-paste every project
Small enough to read in an afternoon. Solid enough to ship in production.
Zero dependencies
No lodash, no debounce utils, no transitive surprises — React is the only thing you install besides the hooks.
TypeScript-first
Written in TypeScript, shipped with full definitions. Generics and inference just work — no @types hunt.
SSR-safe
Browser APIs stay behind effects by convention — Next.js and Remix prerender without a single window crash.
Tree-shakable
Import one hook, ship one hook. Bundlers drop everything you don't use.
ESM + CJS
Dual builds out of the box — modern bundlers, legacy tooling, and everything in between.
65 hooks & counting
State, storage, DOM, and light data fetching — the daily-driver set, not a kitchen-sink toolkit.
The hooks you keep rewriting — done once
Closest peers like usehooks-ts cover similar ground. hookli pushes harder on zero deps, SSR safety, and docs that never drift from the package you install.
Runtime dependencies
hookli:Zero — React is the only peer
Others:Often lodash, debounce helpers, or other utility packages
SSR safety
hookli:Required by convention — every hook guards browser APIs
Others:Varies hook by hook; easy to break Next.js prerender
Documentation
hookli:Live demos import the published npm package
Others:Often README-only, or docs that drift from the code
Hook list accuracy
hookli:Manifest drives README, docs, and hook count
Others:Hand-maintained lists that fall out of sync
Test coverage
hookli:Every hook has a colocated vitest test
Others:Inconsistent — some hooks tested, many aren't
Bundle cost
hookli:Tree-shakable — import one hook, ship one hook
Others:Shared util layers can pull in more than you use
Not trying to be TanStack Query or a kitchen-sink toolkit — just the typed, SSR-safe hooks you copy-paste in every project, packaged so you never copy-paste them again.
This demo runs the code beside it
The preview imports useTogglestraight from the published npm package — the same code you'd ship.
import { useToggle } from "hookli";
export function LightSwitch() {
const [on, toggle] = useToggle(false);
return (
<button onClick={toggle} aria-pressed={on}>
{on ? "On" : "Off"}
</button>
);
}live · imported from hookli
Bring your AI — it speaks hookli
Vibe-coding with an LLM? hookli ships a machine-readable map of all 65 hooks, so your assistant recommends and wires them up correctly — no stale copy-paste.
One file, the whole library
Point any model at /llms.txt for the map, or /llms-full.txt for every signature, usage and source — generated from the same registry the docs use.
Copy any hook for AI
Every hook page has a one-click Copy for AI — clean Markdown, ready to paste into your chat and start building.
Straight into your chat
Jump into ChatGPT or Claude prefilled with the hook's context and a live docs link. Your AI pair is in the loop from line one.
All 65 hooks
Each one documented with a live demo — try it before you install it.
State
Effects
DOM
Data
Support hookli
hookli is free and ISC-licensed. It runs on stars, issues, pull requests, and sponsorships.
Star it
The fastest way to help — stars bring the contributors that keep hookli moving.
Star on GitHubContribute
Report a bug, sharpen the docs, or add the hook you keep rewriting anyway.
How to contributeSponsor
Back ongoing maintenance and new hooks through GitHub Sponsors — any amount helps.
Become a sponsorEvery hook you rewrite — one import away.
Typed, SSR-safe, zero dependencies. Import what you need and ship.
npm i hookli