# Jotai — card for AI agents

Minimal React state management with atoms as primitive building blocks for flexibility.

Category: State and data fetching · npm package `jotai` · latest version 3.0.1 (checked 2026-11-01)
Install: `npm install jotai`
License: MIT (permissive)

In your own product (generator, app, hosted service): **yes**. Permissive license: ship it inside your own product, closed or open source, and keep its license and copyright notice.

## Rules for AI agents (paste into AGENTS.md or CLAUDE.md)

## Jotai
- Define state as atoms with `atom(initialValue)`. Compute dependent values with derived atoms such as `atom((get) => ...)`.
- When a component only reads an atom, use `useAtomValue`. When it only writes, use `useSetAtom`. Use `useAtom` when the same component does both.
- For actions, use a write-only atom (`atom(null, (get, set, arg) => ...)`). For async actions, make the write function async and call `set` when the data is ready.
- The README marks derived async atoms as needing React Suspense, so plan for a Suspense boundary when you use them.
- With SSR in Next.js or Waku, add a Jotai `Provider` at the root. In the Next.js app directory, put it in a separate `'use client'` component and import it into the root layout.js server component.
- For persisting an atom in localStorage, `jotai/utils` provides `atomWithStorage(key, initialValue)`.
- v3.0.1 fixes a `useAtomValue` regression introduced in v3.0.0, and the release note says "Please update."

## What it is
- In Jotai, global React state is a set of small atoms rather than one store. The website calls this "an atomic approach to global React state management" and credits the library to Daishi Kato. The package is `jotai` on npm, it is MIT licensed, and the GitHub repository was created on 2020-08-11.
- The unit of state is an atom. You create one with `atom(initialValue)` and read or write it in a component with `useAtom`, which the README says can be used like `React.useState`. Pass a read function instead of a value and you get a derived atom. Add a write function as the second argument and the atom becomes writable. Either function can be async. The site says renders "are automatically optimized based on atom dependency."
- The README says it "scales from a simple useState replacement to an enterprise TypeScript application." The package also includes a `jotai/utils` bundle, and official extensions are published as separate packages.

## Caveats
- README flags async atoms as needing Suspense: The README marks derived async atoms with a "needs suspense" badge that links to React's Suspense docs.
- SSR requires a Provider at the root: For server-side rendering with a framework such as Next.js or Waku, the docs say to add a Jotai `Provider` at the root of the app.
- Extra client-component file in the Next.js app directory: In the Next.js app directory, the provider goes in its own `'use client'` component. That component is then imported into the server-side root layout.
- v3.0.0 shipped a useAtomValue regression: The latest release, v3.0.1 (2026-09-29), fixes a regression in `useAtomValue` that was introduced in v3.0.0. The release note says "Please update."

## Numbers (AgentGid data)
- Gid Score: 72.2 (#306 of all tools, 9 of 53 in its category)
- Used in 35 public projects set up for AI coding agents (0.6%)
- Downloads last week: 10,959,394 (as of 2026-11-24), +50.9% over 4 weeks
- GitHub stars: 21,342 (as of 2026-11-24)
- Last push: 2026-11-24

## Often used with
Radix UI 77.1%, date-fns 74.3%, React 97.1%, Zod 82.9%, Class Variance Authority 65.7%, Tailwind Merge 68.6%

## Checked alternatives (same job)
- Zustand: https://agentgid.com/tools/zustand/agent.md
- Redux Toolkit: https://agentgid.com/tools/reduxjs/agent.md

## Links
- AgentGid page: https://agentgid.com/tools/jotai/
- Homepage: https://github.com/pmndrs/jotai
- Repository: https://github.com/pmndrs/jotai
- Source: https://github.com/pmndrs/jotai#readme
- Source: https://github.com/pmndrs/jotai
- Source: https://github.com/pmndrs/jotai/releases
- Source: https://jotai.org

---
AgentGid's catalog is curated: every entry was checked against the maker's official pages (registry, repository, license and pricing pages) on the date shown; a license value shows the quote it stands on wherever AgentGid has one. Usage numbers come from AgentGid's own scan of public repositories set up for AI coding agents. Claims by makers are reported, not tested by AgentGid.
