Jotai

Primitive and flexible atom-based state management for React that scales from a useState replacement to enterprise apps.

Library
npm
v3.0.1
21,297 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
82 /100 Excellent
Development Activity 80
Maintenance 84
Community 64
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
88 /100 Excellent
Architecture 92
Code Quality 90
Innovation 90
Learning Curve 80

Jotai is a primitive and flexible state management library for React built around atoms — small, composable units of state that you read and write with hooks that feel just like useState. Instead of a single global store with string keys, you declare independent atoms and derive new atoms from them, and Jotai handles dependency tracking, re-render optimization, and async resolution for you.

With a minimal 2KB core, a rich set of utilities, and first-class TypeScript support, Jotai scales from replacing a handful of useState calls up to managing complex, interdependent global state in large applications. It works with React, React Native, and any renderer, and supports Suspense-based async atoms out of the box.

What You Get

  • A 2KB core API centered on the atom() primitive and the useAtom family of hooks
  • Derived read-only, write-only, and read-write atoms with automatic dependency tracking
  • Built-in async atoms that integrate with React Suspense for data fetching and pending states
  • A large utility set (atomWithStorage, atomFamily, selectAtom, splitAtom, loadable, and more) plus vanilla and Babel integrations
  • First-class TypeScript types and support for React, React Native, and custom stores

Common Use Cases

  • Replacing scattered useState and prop drilling with shared global atoms
  • Deriving computed values and cross-cutting selectors from multiple pieces of state
  • Fetching and caching server data through async atoms with Suspense
  • Persisting UI state such as theme or preferences to localStorage with atomWithStorage
  • Managing dynamic collections of state with atomFamily and splitAtom

Under The Hood

Architecture — Jotai is organized into a framework-agnostic vanilla layer and a thin react binding layer. The vanilla core (src/vanilla/atom.ts, src/vanilla/store.ts, src/vanilla/internals.ts) defines the atom config object and a store that holds atom state in a WeakMap-based graph, tracking dependencies and recomputing derived atoms via INTERNAL_buildStore. atom() returns a plain config with read/write functions rather than the value itself, so atoms are stateless descriptors and all mutable state lives in the store. The React layer (src/react/useAtom.ts, useAtomValue.ts, useSetAtom.ts, Provider.ts) subscribes components to specific atoms through useSyncExternalStore, so a store change re-renders only the components reading the affected atoms. A default global store is created lazily, with a dev-mode guard warning on multiple Jotai instances.

Tech Stack — Written in TypeScript (~85% of the codebase) with a small JavaScript/CSS remainder. React is an optional peer dependency (>=17.0.0), as are @babel/core, @babel/template, and @types/react, keeping the runtime dependency-free. The build uses Rollup with multiple configs to emit CommonJS and ESM bundles plus separate entry points for vanilla, utils, and Babel plugins/preset, with downlevel-dts producing TypeScript 3.8 type fallbacks. Tooling includes Vitest for tests, ESLint, Prettier, and pnpm workspaces.

Code Quality — The codebase is mature and well-tested, with 49 test files under tests/ covering vanilla store behavior, dependency tracking, derivation, effects, React hooks, and the Babel plugins, run through Vitest with Testing Library and v8 coverage. Files are small and single-responsibility (each utility such as atomWithStorage, atomFamily, and selectAtom lives in its own module under src/vanilla/utils). Internal-only APIs are clearly marked with comments warning they are not part of the public contract, and types are strict throughout.

API Design — The public surface is deliberately minimal: one atom() factory plus a small family of hooks (useAtom, useAtomValue, useSetAtom) that mirror React.useState, so getting started requires almost no boilerplate. Atoms are referenced by identity rather than string keys, eliminating a whole class of naming errors. Read/write/derived variants are expressed by which functions you pass to atom(), a consistent and composable convention, and the extensive documentation at jotai.org plus in-repo examples make the learning curve gentle for anyone already comfortable with React hooks.

Used by 27 apps in this directory

Go
87%
MIT

Hatchet

AI Development · Automation · Developer Tools

8,174

A Postgres-backed orchestration engine for background tasks, AI agents, and durable workflows that replaces Redis queues and multi-datastore durable execution platforms with a single self-hostable service.

View details
88
Repo Health
83
Technical
67
Dependency
Built with
Go 87%
Updated 6 days ago
TypeScript
97%
MIT

HyperDX

Analytics · Developer Tools · Monitoring

9,963

Open source observability platform that unifies logs, traces, metrics, and session replays on ClickHouse — now the core of ClickStack.

View details
89
Repo Health
83
Technical
64
Dependency
Built with
TypeScript 97%
Updated 5 days ago
TypeScript
39%
Apache 2.0

Label Studio

AI Development · Data Engineering

28,540

Label Studio is an open-source, multi-type data labeling platform that lets teams annotate images, text, audio, video, and time series data with a configurable XML-based UI and export annotations in formats ready for any ML framework.

View details
93
Repo Health
87
Technical
64
Dependency
Built with
TypeScript 39%
JavaScript 27%
Python 25%
Updated 6 days ago
TypeScript
85%
MIT

LibreChat

AI Assistants · Developer Tools

46,236

Unite every major AI model in one self-hosted chat platform with agents, code execution, MCP tools, and enterprise authentication.

View details
93
Repo Health
81
Technical
62
Dependency
Built with
TypeScript 85%
JavaScript 14%
Updated 5 days ago
Python
62%
Apache 2.0

marimo

Data Engineering · Developer Tools

23,309

A reactive Python notebook that eliminates hidden state, runs reproducibly, and deploys as a web app or script — stored as pure Python, built for the AI era.

View details
90
Repo Health
91
Technical
65
Dependency
Built with
Python 62%
TypeScript 37%
Updated 5 days ago
TypeScript
97%
MIT

NewsNow

Bookmarks Archiving

22,143

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

View details
75
Repo Health
74
Technical
70
Dependency
Built with
TypeScript 97%
Updated 2 weeks ago
TypeScript
95%
MIT

Open Lovable

AI Development

28,793

An open-source AI app builder that scrapes a live website and recreates it as a modern React app through chat — built by Firecrawl as a self-hostable example of the Lovable.dev workflow.

View details
50
Repo Health
66
Technical
69
Dependency
Built with
TypeScript 95%
Updated 2 weeks ago
TypeScript
93%
Apache 2.0

Openship

Devops · Hosting Control Panel

14,912

Openship is an open-source, self-hostable deployment platform that points at a repo and builds, ships, routes, and TLS-terminates the app — driven from a desktop app, web dashboard, or CLI.

View details
84
Repo Health
85
Technical
65
Dependency
Built with
TypeScript 93%
Updated 5 days ago
TypeScript
96%
Other

Refly

AI Development · Automation · No Code Platforms

7,537

Build deterministic, versioned agent skills from natural language—run them anywhere from Claude Code to Slack.

View details
68
Repo Health
76
Technical
63
Dependency
Built with
TypeScript 96%
Updated 1 weeks 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