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
Why hookli

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.

Live proof

This demo runs the code beside it

The preview imports useTogglestraight from the published npm package — the same code you'd ship.

light-switch.tsxtsx
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

The library

All 41 hooks

Each one documented with a live demo — try it before you install it.

Get involved

Support hookli

hookli is free and ISC-licensed. It runs on stars, issues, pull requests, and sponsorships.

Stop rewriting the same hooks.

npm i hookli
Explore the docs