ahooks

A high-quality, production-tested collection of React hooks

Library
npm
v3.9.7
14,976stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
78/100Good
Development Activity64
Maintenance72
Community76
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
79/100Good
Architecture78
Code Quality82
Innovation75
Learning Curve80

ahooks is a large, well-documented library of reusable React hooks covering everything from basic state and lifecycle helpers (useBoolean, useToggle, useMount) to advanced, business-scenario-driven hooks like useRequest (async data fetching with caching, retry, and polling), useDebounce/useThrottle, drag-and-drop, and DOM interaction hooks (useHover, useClickAway, useInViewport).

Maintained by Alibaba and used extensively across its internal products, ahooks is written in TypeScript with predictable static types, supports SSR, and ships bilingual (English/Chinese) documentation with live demos for every hook — making it one of the most comprehensive general-purpose React hooks collections available.

What You Get

  • A broad catalog of basic hooks (useBoolean, useToggle, useCounter, useMap, useSet, useLatest) for everyday component state
  • useRequest, a full-featured async data-fetching hook with caching, deduplication, polling, retry, and pagination built in
  • DOM and browser interaction hooks (useHover, useClickAway, useInViewport, useDrag/useDrop, useEventListener, useMouse)
  • Debounce/throttle hooks (useDebounce, useDebounceFn, useThrottle, useThrottleFn) and effect variants (useDeepCompareEffect, useAsyncEffect)
  • Bilingual documentation (English/Chinese) with a live CodeSandbox demo for every individual hook

Common Use Cases

  • Replacing hand-rolled useEffect/useState boilerplate for data fetching with useRequest’s caching, retry, and polling behavior
  • Adding debounced/throttled input handling to search boxes and forms without reimplementing timer logic
  • Building drag-and-drop or DOM-interaction features (useDrag, useHover, useInViewport) without a separate dependency per behavior
  • Standardizing common component patterns (toggles, counters, maps/sets as state) across a large team’s codebase

Under The Hood

Architecture — ahooks is organized as a pnpm-workspace monorepo (packages/hooks, plus split-out packages like @ahooksjs/use-url-state) where every hook lives in its own directory under packages/hooks/src/<hookName>/ with a co-located index.ts, __tests__/, demo/, and bilingual markdown docs. This one-hook-per-folder layout keeps each hook independently documented and testable while still being re-exported from a single top-level index.ts barrel file for the published ahooks package.

Tech Stack — Nearly 100% TypeScript, built and bundled for CJS (lib/), ESM (es/), and a UMD unpkg build (dist/ahooks.js), with sideEffects: false set for tree-shaking. useRequest in particular is architected as a plugin-based hook internally, composing smaller behaviors (cache, polling, retry, debounce) as independent plugins layered onto a base fetch hook.

Code Quality — Every hook directory ships its own __tests__ folder, and coverage is tracked via Coveralls (visible in the README badge). Consistent structure across ~80 hooks (test + demo + doc per hook) makes the codebase easy to navigate despite its size, and the top-level index.spec.ts provides an integration-level smoke test across the full public API surface.

API Design — Hooks follow React’s use-prefixed naming convention consistently and are designed to be dropped in with minimal configuration (e.g. useRequest(fetchFn) works out of the box, with options layered on top only when needed). The bilingual per-hook documentation with runnable demos significantly lowers the learning curve for adopting any single hook without needing to understand the whole library.

Used by 11 apps in this directory

TypeScript
72%
AGPL 3.0

APITable

Low Code Platforms · Databases

15,526

API-first collaborative spreadsheet-database platform that auto-generates REST APIs and lets teams build internal tools, CRMs, and dashboards without code.

View details
53
Repo Health
77
Technical
60
Dependency
Built with
TypeScript72%
Java22%
Updated 9 months ago
TypeScript
50%
Other

Dify

No Code Platforms · AI Development · Developer Tools

152,883

Visual LLM workflow platform with RAG pipelines, agent capabilities, and model management for building production AI applications.

View details
92
Repo Health
85
Technical
71
Dependency
Built with
TypeScript50%
Python47%
Updated today
TypeScript
88%
MIT

Drawnix

Design Tools · Productivity

14,567

All-in-one open-source whiteboard combining mind maps, flowcharts, and freehand drawing on a single infinite canvas.

View details
73
Repo Health
69
Technical
83
Dependency
Built with
TypeScript88%
SCSS10%
Updated 3 days ago
TypeScript
89%
Other

FastGPT

AI Agents · AI Development

29,387

Build, debug, and deploy knowledge-based AI agents with a visual workflow editor, RAG retrieval, and support for any OpenAI-compatible LLM.

View details
93
Repo Health
84
Technical
70
Dependency
Built with
TypeScript89%
Updated today
TypeScript
95%
AGPL 3.0

HeyForm

Forms Surveys · No Code Platforms

8,938

Open-source conversational form builder with AI generation, conditional logic, and 30+ integrations — self-host with full data ownership.

View details
86
Repo Health
67
Technical
69
Dependency
Built with
TypeScript95%
Updated today
TypeScript
55%
Other

Jaaz

AI Design Tools · AI Agents

6,552

Open-source AI creative agent that turns visual sketches and canvas gestures into images and videos — no text prompts required.

View details
45
Repo Health
59
Technical
71
Dependency
Built with
TypeScript55%
Python34%
JavaScript10%
Updated 5 months ago
TypeScript
98%
MIT

Kimi Code CLI

AI Code Assistants · AI Agents · Developer Tools

6,908

A single-binary, terminal-native coding agent that reads, edits, and runs code end to end, built by Moonshot AI for Kimi models but pluggable with Anthropic, OpenAI, and Google providers too.

View details
81
Repo Health
87
Technical
66
Dependency
Built with
TypeScript98%
Updated today
TypeScript
99%
Other

LobeHub

AI Assistants · Productivity · Automation

81,816

Your Chief Agent Operator — build, schedule, and collaborate with an entire AI team in one self-hostable workspace.

View details
92
Repo Health
81
Technical
72
Dependency
Built with
TypeScript99%
Updated today
TypeScript
97%
MIT

NewsNow

Bookmarks Archiving

21,466

Self-hostable news aggregator with an elegant column layout, GitHub OAuth, adaptive scraping intervals, and seamless Cloudflare D1 or SQLite persistence.

View details
74
Repo Health
74
Technical
74
Dependency
Built with
TypeScript97%
Updated 1 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