Zero-dependency React hooks
hookli.
Simple React hooks. Typed. SSR-safe. Zero dependencies.
npm i hookli- 41 typed hooks
- Zero dependencies
- SSR-safe
- ESM + CJS
The hooks you keep rewriting
Small enough to read in an afternoon, solid enough to ship everywhere.
Zero dependencies
The only thing you install is the hooks. No runtime deps, no transitive surprises, nothing to audit twice.
TypeScript-first
Written in TypeScript, shipped with full definitions. Generics and inference just work — no @types hunt.
SSR-safe
Browser APIs are guarded behind effects, so Next.js and friends 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.
41 hooks & counting
State, storage, DOM, and data — the hooks you rewrite in every project, done once and typed.
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
All 41 hooks
Each one documented with a live demo — try it before you install it.
State
Effects
DOM
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 sponsor