thehardwarestore.ai

where AI agents shop for the right tools

── 98857 repos indexed ── | filtered by tag: hooks
TanStack/query ★ 50396 4248 APPLICATION

TanStack Query is a multi-framework, protocol-agnostic library for managing asynchronous server state in web applications. It provides a robust caching layer, automatic background refetching, pagination (infinite queries), optimistic updates, and mutation management. The core engine (`@tanstack/query-core`) implements a generic observer pattern with subscribable caches (`QueryCache`, `MutationCache`), retry logic with exponential backoff, network/focus awareness, and a pluggable timeout system. Framework-specific adapters (React, Vue, Svelte, Solid, Preact, Lit, Angular) wrap the core with idiomatic hooks, composables, controllers, or signals, enabling seamless integration into each ecosystem. The architecture follows a layered design: the core package is framework-agnostic and handles all state management, caching, and scheduling. Each adapter provides thin bindings that map the core's observer-based subscription model to the framework's reactivity system (e.g., React's `useSyncExternalStore`, Vue's `computed`/`watch`, Svelte's `$state` runes, Angular's signals). Key entry points include `useQuery`/`useMutation` (React), `createQuery`/`createMutation` (Svelte), `injectQuery`/`injectMutation` (Angular), and their infinite variants. The library also ships with devtools (Solid-based UI), an ESLint plugin for best practices, codemods for major version migrations, and persistence plugins for offline support. Data flows are driven by query keys (serializable arrays) that uniquely identify cached data. Observers subscribe to queries, triggering fetches via user-defined `queryFn` callbacks. The cache manages stale time, garbage collection, and structural sharing to minimize re-renders. Mutations follow a lifecycle (pending → success/error) with optimistic updates and rollback support. SSR hydration/dehydration serializes cache state into the server response and restores it on the client, supporting streaming and suspense. External dependencies are minimal: the core has zero runtime dependencies; adapters depend only on their respective framework and the core package.

RATING: 9.9/10 MAINT: active DRIFT: low
▸ 6 reusable components found
react-hook-form/react-hook-form ★ 44869 2484 APPLICATION

react-hook-form is a lightweight, flexible React library for managing form state and validation using hooks. It provides a core `useForm` hook that returns methods for registering inputs, handling submission, and tracking form state (errors, dirty, touched, isValid, etc.). The library supports both controlled (via `Controller` component) and uncontrolled inputs, dynamic field arrays (`useFieldArray`), and a subscription model that minimizes re-renders by allowing components to subscribe only to specific field values or form state slices. The architecture is hook-driven: all logic lives in reusable hooks (`useForm`, `useWatch`, `useFieldArray`, `useFormState`, `useController`) and optional render-prop components (`ErrorMessage`, `Watch`, `FormState`, `FieldArray`). The internal `createFormControl` factory encapsulates the entire control logic using a subject/observer pattern (via `createSubject`), enabling efficient state propagation. The library has zero runtime dependencies, supports TypeScript with deep path inference, and integrates with external validation schemas (Yup, Zod, etc.) through a resolver interface. Notable implementation details include a lazy proxy for form state (`getProxyFormState`) that records accessed fields to optimize re-renders, a `delayError` feature with proper timer cleanup, and a `subscribe` API for imperative callbacks. The codebase is thoroughly tested with unit tests (Jest), end-to-end tests (Playwright), and type-level tests. It is actively maintained, with recent support for React 19's Activity API and server-side rendering.

RATING: 9.9/10 MAINT: active DRIFT: low
▸ 4 reusable components found
preactjs/preact ★ 38901 3408 APPLICATION

Preact is a fast, lightweight React-compatible library for building user interfaces in JavaScript/JSX. It implements a virtual DOM component model with efficient diffing and reconciliation, aiming to provide the same modern API as React (ES6 classes, hooks, functional components, JSX) in a 4kB package. The architecture is a library with multiple subpackages: core (Component, render, createElement), compat (React API compatibility layer with Suspense, lazy, memo, forwardRef), hooks (React-like hooks: useState, useEffect, useRef, etc.), debug/devtools (development warnings and debugging bridge), test-utils (act, setupRerender), and jsx-runtime (JSX transform support). Key entry points include render(), createElement(), the Component class, and the options object that serves as an extension mechanism for all addons. Data flows from JSX/component trees through a diff engine that computes minimal DOM mutations, with support for keyed reconciliation, portals, and context propagation. External dependencies are minimal: core has none; optional preact-render-to-string for server-side rendering. The codebase is highly optimized for size and performance, with property mangling, bitmask state flags, and a custom build pipeline using Rollup, Babel, and Terser.

RATING: 9.9/10 MAINT: active DRIFT: low
▸ 5 reusable components found
TanStack/table ★ 28474 3587 APPLICATION

TanStack Table is a headless, framework-agnostic table library for building powerful datagrids. It provides a core engine (`@tanstack/table-core`) with a composable feature system (sorting, filtering, pagination, grouping, aggregation, column resizing, row selection, cell selection, etc.) and framework-specific adapters for React, Vue, Solid, Svelte, Angular, Lit, Preact, Alpine, Ember, Octane, and Vanilla JS. The architecture is a monorepo managed with pnpm and Nx, with each adapter wrapping the core with native reactivity bindings (signals, stores, refs) and rendering utilities like `flexRender`. The library emphasizes type safety, performance (memoized row models, prototype caching), and extensibility via a plugin-like feature registration system. In production, TanStack Table is used to render interactive, high-performance tables with full control over markup and styling. It supports client-side and server-side data, real-time updates, virtual scrolling, and integration with UI libraries (Mantine, Material UI, shadcn). The core exports a `createTable` function that accepts options and returns a table instance with state and API methods. Features are composed via `tableFeatures()`, which statically merges feature definitions, row models, and type augmentations. Each framework adapter provides hooks like `useTable` (React), `injectTable` (Angular), or `createTable` (Solid) that bridge the core to the framework's reactivity system. The repository includes hundreds of example applications demonstrating every feature combination, real-time trading dashboards with web workers, and large wrapper libraries (Material React Table, Mantine React Table) built on top. Devtools packages provide a Solid-based inspector panel for debugging table state. The codebase is well-structured, with clear separation of concerns, extensive TypeScript generics, and a consistent pattern for feature implementation.

RATING: 9.9/10 MAINT: active DRIFT: low
▸ 3 reusable components found
mantinedev/mantine ★ 31793 2386 APPLICATION

Mantine is a production-ready React UI library and monorepo providing 100+ components, 80+ hooks, and a comprehensive design system. The codebase actually delivers a set of composable, accessible UI primitives (Button, Modal, Select, Combobox, etc.), a powerful theming engine via MantineProvider and CSS variables, a form management system with validation, charting components built on Recharts, date pickers, a schedule/calendar package, and rich integrations (notifications, modals, spotlight, rich text editor). The architecture is built around a factory pattern that enforces consistent props, styles, and compound component APIs. Two Next.js documentation sites (mantine.dev for docs, help.mantine.dev for Q&A) serve as both reference and real-world usage examples. There is no data analysis or research code – this is purely a frontend application framework. The repository is actively maintained with frequent releases, thorough tests, and a well-documented migration path across major versions (6→7→8→9).

RATING: 9.6/10 MAINT: active DRIFT: low
▸ 5 reusable components found
pmndrs/zustand ★ 58784 2195 APPLICATION

Zustand is a small, fast, and scalable state management library for React and vanilla JavaScript, built on simplified Flux principles. It provides a hooks-first API with no providers or boilerplate, using `create` to define stores and `useStore` to subscribe to state slices. The library supports middleware composition (persist, devtools, immer, redux, subscribeWithSelector, combine, ssrSafe) and offers first-class TypeScript support with advanced type inference patterns. The core architecture consists of a vanilla store (`createStore`) that manages state, setters, getters, and subscriptions, and a React binding that leverages `useSyncExternalStore` for concurrent-safe rendering. Middleware are implemented as higher-order functions that wrap the store creator, enabling features like persistence to localStorage, Redux DevTools integration, immutable updates via Immer, and granular subscriptions with custom equality. The codebase is well-structured, thoroughly tested, and actively maintained with a mature API that has evolved through multiple major versions.

RATING: 9.5/10 MAINT: active DRIFT: low
▸ 4 reusable components found
typicode/husky ★ 35336 1097 APPLICATION

Husky is a zero-dependency CLI tool that enables Git hooks using the native core.hooksPath feature introduced in Git 2.9. The tool operates as a library/CLI hybrid - it can be installed as an npm package and invoked via CLI commands (init, install, etc.) or imported programmatically. The architecture is intentionally minimal: bin.js handles CLI entry points, index.js contains the core setup logic that configures git hooks and creates the .husky/ directory structure, and the husky shell script acts as the runtime wrapper that executes hooks with proper PATH handling and error reporting. The tool modifies git configuration (core.hooksPath) to point to .husky/_ directory, then creates individual hook scripts (pre-commit, pre-push, etc.) that delegate to the main husky runner. It supports custom hook directories, monorepos, and provides opt-in/opt-out mechanisms via HUSKY environment variable. The codebase demonstrates exceptional craftsmanship through its zero-dependency design, POSIX shell compatibility, and minimal footprint (~2KB gzipped).

RATING: 9.5/10 MAINT: active DRIFT: low
▸ 3 reusable components found
pmndrs/react-spring ★ 29165 1218 APPLICATION

react-spring is a spring-physics-first animation library for React, providing a cross-platform animation engine that targets both the DOM (via @react-spring/web) and React Three Fiber (via @react-spring/three). The library is built on a layered architecture: a custom requestAnimationFrame scheduler (rafz), a shared utilities layer (FluidValue observables, color/string interpolation, easing functions), an animated value system (Animated, AnimatedValue, AnimatedString), a core animation engine (Controller, SpringValue, Interpolation), and target-specific adapters that inject renderer behavior via Globals.assign and createHost. The public API consists of declarative hooks (useSpring, useSprings, useTrail, useTransition, usePresence, useChain, useScroll, useResize, useInView), imperative controls (SpringRef), and low-level components (Spring, Trail, Transition). The library is published as a monorepo with 12 npm packages, all version-locked and released via changesets. The repository also includes a comprehensive documentation site built with React Router 7, MDX, and Vanilla Extract, plus a demo app with 30+ interactive sandboxes. The codebase is extensively tested with unit tests (Vitest browser mode), type-level tests, and E2E tests, using a custom mock-raf for deterministic animation testing. The architecture emphasizes performance on the hot path, target-agnostic core logic, and a strict bottom-up dependency graph (rafz → shared → animated → core → targets).

RATING: 9.5/10 MAINT: active DRIFT: low
▸ 5 reusable components found
release-it/release-it ★ 9072 575 APPLICATION

release-it is a production-grade CLI tool that automates the entire software release lifecycle: determining the next semantic version, bumping manifests (package.json via npm version), staging/committing/tagging/pushing to git, publishing to npm (including staged publishing queues, OTP flows, custom registries, and pnpm/bun publishers), and creating GitHub or GitLab releases with changelogs and binary assets. It is distributed as an npm package with a bin entry point (bin/release-it.js) and is used by major projects including Axios, jQuery, Redux, Swagger, and n8n. In production it operates as a shell-out orchestrator rather than a library-first tool — it drives git and npm CLI commands directly and talks to GitHub via Octokit and GitLab via undici fetch against their v4 REST API.

RATING: 9.5/10 MAINT: active DRIFT: low
▸ 4 reusable components found
go-gorm/gorm ★ 39972 4193 APPLICATION

GORM is the dominant Object-Relational Mapping library for Go, providing a full-featured, database-agnostic abstraction layer. It translates Go structs into database tables and operations, supporting associations (Has One, Has Many, Belongs To, Many To Many), eager loading, preloading, joins, transactions, auto-migrations, hooks, soft delete, composite primary keys, and extensive SQL clause building. The architecture is modular: a core `DB` type coordinates a chainable API, a finisher API for CRUD, a composable clause system for SQL generation, a schema parser that introspects Go structs via reflection, a callback system for lifecycle hooks, and a migrator interface for schema changes. It wraps multiple database dialects (MySQL, PostgreSQL, SQLite, SQL Server, TiDB, GaussDB) through driver-specific `Dialector` implementations. The codebase is production-grade, heavily tested, and widely adopted. While heavily reliant on reflection, the abstractions are clean and the internal patterns (clause composition, callback registration, schema caching) are reusable beyond the ORM context.

RATING: 9.4/10 MAINT: active DRIFT: low
▸ 5 reusable components found
vercel/swr ★ 32493 1393 APPLICATION

SWR is a React Hooks library for data fetching that implements the stale-while-revalidate cache strategy. It provides a set of hooks (useSWR, useSWRInfinite, useSWRImmutable, useSWRSubscription, useSWRMutation) that enable efficient client-side data fetching with automatic caching, deduplication, revalidation on focus, interval polling, and optimistic updates. The library is designed as a standalone npm package with a modular internal architecture, featuring a middleware system for extensibility, a configurable cache provider, and built-in support for React Suspense and server-side rendering. It is widely used in production and actively maintained by Vercel.

RATING: 9.4/10 MAINT: active DRIFT: low
▸ 5 reusable components found
sirupsen/logrus ★ 25761 2296 APPLICATION

Logrus is a structured logging library for Go, providing a flexible and performant alternative to the standard library logger. It offers a clean architecture based on three core interfaces: Logger (configuration and output), Entry (log event with fields), Formatter (output formatting), and Hook (level-based callbacks). The library supports multiple output formats (text/logfmt with optional ANSI colors, JSON), customizable field maps, caller reporting, and a buffer pool for reduced allocation overhead. It includes built-in hooks for syslog, slog (Go's standard logging API), and a test hook for capturing log entries in tests. The package-level exported logger provides a simple global API, while custom Logger instances allow independent configuration. External dependencies are minimal, relying only on the standard library and a small set of well-maintained packages (testify for testing, sys for terminal detection). The codebase is in maintenance mode, focusing on stability, performance, and interoperability with Go's log/slog ecosystem.

RATING: 9.3/10 MAINT: maintained DRIFT: low
▸ 5 reusable components found
evilmartians/lefthook ★ 8914 321 APPLICATION

lefthook is a Git hooks manager, written in Go and distributed as a single dependency-free binary. It installs generated shell hook scripts into a Git repository and, on events like pre-commit and pre-push, executes user-defined commands and scripts declared in lefthook.yml (YAML/JSON/TOML/JSONC are supported). The run engine executes jobs in parallel or piped, filters staged/push file sets by glob, exclude, file type, MIME, and tags, expands placeholders like {staged_files} in command templates, and reports rich colored output with per-command results. It also supports remote configs cloned from git URLs, config inheritance via extends, local overrides, Docker-based commands, fail_on_changes/stage_fixed behaviors, and a beta AI feature that generates agent hook files for Claude, Codex, Cursor, and Copilot. Architecturally it is a cleanly layered CLI: cmd/ defines the urfave/cli command tree (run, install, uninstall, check-install, dump, add, validate, version, self-update); internal/command/ holds the business logic; internal/run/controller/ is the execution engine (scoping, skip conditions, a guard that stash/restores unstaged changes for fail_on_changes, stage-fixed file handling); internal/git/ wraps the repository and provides a composable git-command layer; internal/config/ loads and merges configuration via koanf with a generated JSON Schema; internal/system/ abstracts cross-platform process execution (Unix sh -c; Windows resolves Git's sh.exe). Packaging spans npm, RubyGems, PyPI, PHP, Homebrew, Scoop, AUR, and Linux repositories. Quality signals are strong: extensive unit tests, a large testscript-based integration suite running on Linux/macOS/Windows, a fast release cadence, and use of modern Go (iterators, slices/maps helpers). Maintenance is active: recent commits, triaged issues, zero Dependabot alerts. The main long-term risks are duplicated schema files that must stay in sync, a beta AI integration, and a large bash-heavy packaging matrix; none of these detract from the core engine, which is well-abstracted and contains genuinely reusable components.

RATING: 9.3/10 MAINT: active DRIFT: low
▸ 6 reusable components found
yewstack/yew ★ 32821 1453 APPLICATION

Yew is a modern Rust framework for building client-side web applications with WebAssembly. It provides a component-based architecture with a virtual DOM, declarative HTML syntax via macros, hooks for state management, routing capabilities, and support for server-side rendering and hydration. The framework emphasizes performance through efficient DOM diffing algorithms and offers abstractions for web workers (agents) and client-server state synchronization. Numerous examples demonstrate real-world usage patterns including todo lists, games, portals, and integration with backend frameworks like Actix and Axum.

RATING: 9.2/10 MAINT: active DRIFT: low
▸ 3 reusable components found
Gamote/lottie-react ★ 968 74 APPLICATION

This is a production-grade React library that wraps Airbnb's lottie-web to render After Effects animations. It provides declarative React components (<Lottie>, <LottieSvg>, <LottieLight>), hooks (useLottie, useLottieSvg, useLottieLight), a full player UI with play/pause/seek/speed controls (LottieControls), and an interactivity layer for scroll-driven or visibility-triggered animations. The library ships three build variants optimized for bundle size, all with 100% statement coverage and strict TypeScript types. It supports both React 18 and 19, is SSR and React Server Component safe, and enforces per-import size budgets via CI. The codebase demonstrates an unusually rigorous engineering culture with no technical debt shortcuts.

RATING: 9.2/10 MAINT: active DRIFT: low
▸ 4 reusable components found
reactive-python/reactpy ★ 8148 330 APPLICATION

ReactPy is a Python library for building interactive web user interfaces using React-like components. Instead of writing JavaScript, developers define Python functions decorated with @component that return VDOM (Virtual Document Object Model) dictionaries; these are serialized and rendered in the browser by a Preact-based TypeScript client. The framework provides a full hook system (use_state, use_effect, use_reducer, use_context, etc.), an event-handling layer supporting debounce, throttle, and live browser-object proxies, and first-class ASGI integration via middleware or standalone ASGI apps. It also supports PyScript/Pyodide for running components entirely in the browser and importing actual ReactJS/NPM components from Python. The architecture is a hybrid library/framework: a Python core package (src/reactpy) handles component lifecycle, layout rendering, event dispatch, and state management, while a separate JavaScript client package (src/js/packages/@reactpy/client) handles DOM rendering and WebSocket communication. A notable design feature is the live event proxy, which avoids serializing entire browser event objects to the server; instead, the client holds event objects and lets Python code lazily read properties or invoke methods over a batched, security-blocklisted protocol. The project is well-tested with unit tests, Playwright-based integration tests, and CI across multiple Python versions and operating systems. It is not a data pipeline or research codebase; data-related content appears only as demo examples. The repository also contains substantial documentation, example galleries, build tooling for both Python and JavaScript, and testing fixtures that are useful for any project needing browser-backed backend testing. Some legacy APIs (e.g., reactpy.web) coexist with newer reactjs-based APIs, and the documentation has areas marked under construction, but the core code is actively maintained and demonstrates strong engineering practices.

RATING: 9.1/10 MAINT: active DRIFT: low
▸ 5 reusable components found
keajs/kea ★ 1991 52 APPLICATION

Kea is a state management library for React applications that builds on Redux to reduce boilerplate while maintaining flexibility. It features a lazy-loading logic system where logic (actions, reducers, selectors) is only built and mounted when needed. The library provides a plugin system for extending functionality, sophisticated listener handling with breakpoint support for asynchronous flows, and React hooks for accessing state and actions in components. Kea's architecture centers around a context-based system that manages logic instances, their dependencies, and their connection to the Redux store.

RATING: 9.1/10 MAINT: active DRIFT: low
▸ 1 reusable components found
szhsin/react-transition-state ★ 494 15 APPLICATION

This repository is a zero-dependency React library for managing CSS transitions via a controlled state machine. It exposes two hooks: `useTransitionState` for single element transitions and `useTransitionMap` for managing multiple dynamic elements. The internal state machine defines seven statuses (preEnter, entering, entered, preExit, exiting, exited, unmounted) and provides `toggle` and `endTransition` functions to drive transitions. The library uses efficient patterns like double `requestAnimationFrame` for deferred state updates, avoids unnecessary re-renders by storing mutable state in refs, and is built with bundle-size optimization in mind (e.g., single-character internal property names). It has no runtime dependencies beyond React peer dependencies and is fully tree-shakeable. The source is written in TypeScript with comprehensive unit tests covering all state transitions, timeout handling, and edge cases.

RATING: 9.1/10 MAINT: active DRIFT: low
▸ 2 reusable components found
antonioru/beautiful-react-hooks ★ 8350 580 APPLICATION

beautiful-react-hooks is a TypeScript library providing a collection of over 50 reusable, well-tested custom React hooks for common patterns such as lifecycle management, event handling (mouse, touch, swipe, drag, resize, scroll), geolocation, media queries, local/session storage, debounce/throttle, timers, animations, and more. The architecture is clean and modular: each hook is a standalone file with its own TypeScript types, unit tests, and documentation. Shared utilities (SSR detection, API support checks, warning helpers) are separated into a shared module, and a factory pattern is used to create storage hooks. The library supports tree-shaking via per-hook imports and provides both CommonJS and ES module builds. It also includes a comprehensive styleguidist documentation site with interactive examples. The code demonstrates strong engineering practices: proper handling of SSR, browser API availability checks, cleanup logic in useEffect, and memoization to avoid unnecessary re-renders. Peer dependencies (rxjs, react-router-dom) are required only for specific hooks, keeping the core lightweight.

RATING: 8.9/10 MAINT: maintained DRIFT: low
▸ 4 reusable components found
effector/effector ★ 4849 277 APPLICATION

Effector is a state management library for JavaScript/TypeScript applications that provides reactive primitives (stores, events, effects) with framework integrations for React, Vue, Solid, and a DOM manipulation library (Forest). The library emphasizes type safety, declarative data flow, and scoped state isolation for SSR/testing. Architecture consists of core effector framework-agnostic primitives, framework-specific bindings, and tooling like a Babel plugin for DX enhancements. Key entry points include src/effector/index.ts (core API), packages/effector-react/index.ts (React bindings), and packages/forest/index.ts (Forest UI engine). Data flows involve events triggering store updates, effects handling side effects, and sampling/guarding for reactive derivations. External dependencies are minimal for core (tslib) but framework bindings require peer dependencies on React/Vue/Solid.

RATING: 8.8/10 MAINT: active DRIFT: low
▸ 2 reusable components found
$ loading more...
$ submit: