usehooks-ts

A tree-shakable collection of 30+ ready-to-use React hooks, written in TypeScript.

Library
npm
v3.1.1
7,850stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
61/100Good
Development Activity48
Maintenance32
Community64
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
87/100Excellent
Architecture85
Code Quality88
Innovation84
Learning Curve90

usehooks-ts is a React hooks library written entirely in TypeScript that packages the most common client-side patterns into a single, dependency-light import. It ships more than thirty focused hooks covering boolean and counter state, localStorage and sessionStorage persistence, media queries, event listeners, intersection and resize observers, debouncing, dark mode, and more.

The library is designed to be minimal and fully tree-shakable through its ESM build, so you only pay for the hooks you actually import. Each hook is strongly typed, documented with JSDoc, and covered by tests, making it a low-risk way to avoid re-writing the same boilerplate across React projects.

What You Get

  • 30+ typed React hooks importable individually from a single package
  • Full TypeScript type inference on every hook’s arguments and return values
  • SSR-friendly hooks with options like initializeWithValue for safe hydration
  • A tree-shakable ESM build so only the hooks you import are bundled
  • Extensive JSDoc documentation and a companion docs site with live examples

Common Use Cases

  • Persisting UI state across reloads with useLocalStorage or useSessionStorage
  • Building responsive layouts and theming with useMediaQuery and useDarkMode
  • Wiring up DOM interactions via useEventListener, useHover, and useOnClickOutside
  • Throttling expensive updates with useDebounceValue or useDebounceCallback
  • Tracking element visibility and size with useIntersectionObserver and useResizeObserver

Under The Hood

Architecture — The library is a pnpm + Turborepo monorepo whose publishable surface is the packages/usehooks-ts package. Its src/index.ts is a flat barrel that re-exports one directory per hook (useBoolean, useLocalStorage, useMediaQuery, and 30+ more), so each hook is an isolated module with its own implementation and colocated *.test.ts file. Hooks compose internally rather than duplicating logic — for example useLocalStorage builds on useEventCallback and useEventListener, and dispatches a custom local-storage window event to keep every consumer of a key in sync across components and tabs.

Tech Stack — Written in TypeScript (~90% of the codebase) targeting React 16.8+ through 19 via a broad peerDependencies range. The only runtime dependency is lodash.debounce. It is bundled with tsup (esbuild) into dual ESM/CJS outputs with generated .d.ts types and sideEffects: false for tree-shaking. Tests run on Vitest against a jsdom environment with Testing Library, and the repo uses Turborepo, changesets for releases, TypeDoc for docs generation, and ESLint including a tree-shaking lint plugin.

Code Quality — Quality is high: nearly every hook ships a dedicated Vitest suite (29 test files across 33 hooks), and each public hook carries thorough JSDoc with parameter docs, @example blocks, and links to the docs site. SSR safety is handled explicitly through an IS_SERVER guard and opt-in initializeWithValue options rather than left to the caller. Naming is consistent and idiomatic, and generics preserve full type inference on return tuples.

API Design — The developer experience is a core strength. Every hook is imported by name from the package root, follows React’s own tuple/return conventions, and requires almost no boilerplate to adopt (const [value, setValue] = useLocalStorage('key', 0)). Options objects are optional with sensible defaults, the public API is uniform across the whole set, and each hook maps to a documented page with live examples, giving a very shallow learning curve for React developers.

Used by 26 apps in this directory

TypeScript
94%
MIT

Actual

Invoicing Finance

28,224

Local-first personal finance with envelope budgeting, end-to-end encryption, and multi-device sync — no subscription required.

View details
93
Repo Health
85
Technical
77
Dependency
Built with
TypeScript94%
Updated yesterday
TypeScript
59%
Other

agenta

Developer Tools · Devops · AI Development

4,489

The open-source LLMOps platform unifying prompt engineering, evaluation, and observability for teams building reliable LLM applications.

View details
91
Repo Health
77
Technical
67
Dependency
Built with
TypeScript59%
Python39%
Updated today
Python
90%
Apache 2.0

Apache Airflow

Data Engineering

46,530

Define, schedule, and monitor complex data workflows as Python code — with a powerful UI, 80+ provider integrations, and battle-tested scalability across thousands of production deployments.

View details
96
Repo Health
89
Technical
66
Dependency
Built with
Python90%
Updated today
TypeScript
51%
MIT

Anarlog

Note Taking · AI Assistants · Productivity

9,087

Anarlog is an open-source, local-first AI meeting notetaker that records, transcribes, and summarizes meetings entirely on your device — no cloud lock-in, no mandatory account, and every note saved as a plain markdown file you own forever.

View details
86
Repo Health
77
Technical
69
Dependency
Built with
TypeScript51%
Rust38%
Updated today
TypeScript
89%
Other

anytype-ts

Knowledge Management · Note Taking · Collaboration

8,665

A local-first, end-to-end encrypted knowledge OS that lets you build notes, tasks, wikis, and entire apps — with your data stored offline and synced peer-to-peer.

View details
88
Repo Health
78
Technical
67
Dependency
Built with
TypeScript89%
Updated yesterday
TypeScript
66%
Apache 2.0

Appsmith

Developer Tools · Automation · No Code Platforms

40,707

Open-source low-code platform to build admin panels, dashboards, and internal tools connected to any database or API.

View details
94
Repo Health
79
Technical
68
Dependency
Built with
TypeScript66%
Java22%
Updated today
Rust
86%
Other

Arroyo

Data Engineering · Analytics

5,005

A distributed stream processing engine written in Rust that lets you write SQL to run stateful, real-time computations over data streams with subsecond results.

View details
86
Repo Health
74
Technical
62
Dependency
Built with
Rust86%
Updated 1 weeks ago
TypeScript
92%
GPL 3.0

Blinko

Knowledge Management · Note Taking

10,880

A self-hosted, AI-powered card note-taking tool that lets you capture fleeting thoughts instantly and retrieve them with natural language search.

View details
83
Repo Health
69
Technical
65
Dependency
Built with
TypeScript92%
Updated 2 weeks ago
TypeScript
92%
MIT

Dittofeed

Marketing · Automation

2,903

Open-source omni-channel customer engagement platform for automating transactional and marketing messages via email, SMS, WhatsApp, Slack, and mobile push.

View details
54
Repo Health
75
Technical
63
Dependency
Built with
TypeScript92%
Updated 4 months ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search