# Jotai

Open\-source React state management built from composable atoms, with scoped stores and optional browser persistence\.

ID: Q837 · Revision: 885

Type: software · License: MIT[^license] · Status: active

Website: https://jotai.org/



Jotai is an MIT\-licensed state\-management library for React applications\. It represents shared values as atoms and builds derived state by tracking dependencies between them\. It can substitute for a centralized Zustand store when a project prefers independently composed state units, while requiring changes to subscriptions, updates and persistence\. Providers can scope the same atom definitions to separate component trees\.[^intro][^compare][^provider][^license]

## Building state from atoms

Primitive atoms hold values such as a selected item, filter or draft field\. Derived atoms read other atoms to calculate a value, and writable atoms can coordinate updates\. Jotai tracks reads in a derived atom so the dependency graph determines which calculations need updating\. This organization can suit an application whose features own small pieces of shared state, rather than requiring every value to live in one application\-wide object\. Atom definitions are objects with identities: recreating them during every render can cause update loops, so dynamically created definitions need stable references\.[^atom][^intro]

## Store scope and server rendering

Atom definitions do not themselves contain their current values; stores do\. A Provider supplies a store to a component subtree, and separate Providers can give the same definitions independent values\. This is useful for isolated editor panels or multiple instances of a widget\. The store API also exposes get, set and subscription methods for code outside React components\. Without a Provider, Jotai uses a default store\.[^provider][^store]

Server\-rendered applications need deliberate request isolation\. The Next\.js guide warns that a long\-lived default store can share values across requests and recommends a Provider whose lifetime is limited to the request\. Moving from a client\-only prototype to server rendering therefore involves more than copying the same module\-global state setup\.[^next]

## Saving selected state

The optional atomWithStorage utility connects an atom to storage\. Its default implementation uses browser localStorage with JSON serialization and listens for storage events between tabs; custom implementations can use other storage\. Parsed JSON still needs validation when an application expects a particular shape\. Server rendering cannot read the browser's stored values, so an initial server value may differ from the saved client value\. The storage guide describes guarding server access and delaying dependent content until the client has hydrated\. A persisted preference is useful, but persistence alone does not provide a database or a cross\-device synchronization service\.[^storage]

## Version requirements

The published 3\.0\.1 package declares an MIT license\. The v3 migration guide specifies React 18, TypeScript 5\.5 and Node\.js 22\.12 or newer where those tools are used\. Version 3 supplies ESM builds and restricts package exports to documented entry points\. Some formerly bundled utilities moved to separate packages, including atomFamily and the Babel plugins\. Existing snippets should be checked against the installed major version, particularly when generated code assumes older utility imports\.[^license][^v3]

## When it can substitute for Zustand

Jotai can substitute for [Zustand](/zustand) for shared React client state when a team prefers composing primitive and derived atoms\. Zustand groups values and update actions in stores and commonly uses selectors for subscriptions; Jotai follows atom dependencies\. Choosing Jotai can keep a feature's state and derived values close to its components, while Zustand may fit a straightforward module\-level store\. Migration requires rewriting reads and update operations and checking store scope, derived calculations and persisted data\. The overlap does not establish API or middleware compatibility, or guarantee a performance improvement\.[^compare][^zustand][^provider][^storage]

## When it can substitute for Redux Toolkit

Jotai can also substitute for [Redux Toolkit](/reduxtoolkit) when a React application needs shared client state but its team prefers atom reads and writes over action dispatch and slice reducers\. Derived atoms can express relationships among values without organizing them into Redux slices\. Existing reducers, selectors and middleware behavior need to be reimplemented or retained separately\. Redux Toolkit also includes optional RTK Query for fetching and caching server data; replacing client state with Jotai does not by itself reproduce that cache or its request lifecycle\. The decision is about the state model that suits the application, rather than a universal ranking of the libraries\.[^intro][^atom][^redux-toolkit]

## Capabilities and substitutions

### [Substitute for Zustand](/zustand) — limited

Can replace Zustand for shared React state when composable atoms and dependency\-based subscriptions suit the application\. Rewrite store reads, update actions and derived state; verify Provider scope and persisted\-data handling\. This is not API or middleware compatibility and does not imply a measured performance advantage\.[^provider][^storage][^compare][^zustand]

Use case: Shared React client state and derived values · Platforms: React applications · Region: Version and framework configuration apply

### [Substitute for Redux Toolkit](/reduxtoolkit) — limited

Can replace Redux Toolkit for shared React client state after translating reducers, selectors and dispatch\-based updates into atoms\. Choose it when atom composition fits the application\. Existing middleware behavior and RTK Query server\-data caching require separate treatment; this is not a drop\-in API replacement\.[^intro][^atom][^redux-toolkit]

Use case: Shared React client state without requiring Redux action and slice architecture · Platforms: React applications · Region: Version and application integrations apply

## References

[^intro]: [Jotai overview](<https://jotai.org/>) — Atomic state, derived values and separate reading/writing hooks (vendor; retrieved 2026-10-09T03:46:00Z)

[^atom]: [Jotai atom API](<https://jotai.org/docs/core/atom>) — Primitive and derived atoms; tracked dependencies; stable object identity (vendor; retrieved 2026-10-09T03:46:00Z)

[^provider]: [Jotai Provider](<https://jotai.org/docs/core/provider>) — Subtree stores, default store and remount reset (vendor; retrieved 2026-10-09T03:46:00Z)

[^store]: [Jotai store API](<https://jotai.org/docs/core/store>) — get, set and sub methods outside component hooks (vendor; retrieved 2026-10-09T03:46:00Z)

[^storage]: [Jotai storage utilities](<https://jotai.org/docs/utilities/storage>) — atomWithStorage, JSON validation, server rendering and hydration (vendor; retrieved 2026-10-09T03:46:00Z)

[^next]: [Jotai Next\.js guide](<https://jotai.org/docs/guides/nextjs>) — Provider lifetime and request isolation (vendor; retrieved 2026-10-09T03:46:00Z)

[^v3]: [Jotai v3 migration](<https://jotai.org/docs/guides/migrating-to-v3>) — React, TypeScript and Node requirements; ESM packaging; moved utilities (vendor; retrieved 2026-10-09T03:46:00Z)

[^license]: [Jotai 3\.0\.1 package metadata](<https://registry.npmjs.org/jotai/3.0.1>) — Published package license field: MIT; version and engine requirements (vendor; retrieved 2026-10-09T03:46:00Z)

[^compare]: [Jotai comparison with Zustand](<https://jotai.org/docs/basics/comparison>) — Atom composition versus object stores and module/context organization (vendor; retrieved 2026-10-09T03:46:00Z)

[^zustand]: [Zustand comparison with other tools](<https://zustand.docs.pmnd.rs/learn/getting-started/comparison.html>) — Jotai: state model and render optimization (vendor; retrieved 2026-10-09T03:46:00Z)

[^redux-toolkit]: [Redux Toolkit introduction](<https://redux.js.org/toolkit/introduction/getting-started>) — configureStore, createSlice, React Redux bindings and separate optional RTK Query (vendor; retrieved 2026-10-09T03:48:00Z)

[^source-12]: [https://jotai\.org/docs/basics/comparison](<https://jotai.org/docs/basics/comparison>) — How Jotai differs from Zustand: atom composition, store organization and use cases\. (assessment; retrieved 2026-10-09T03:45:37.013Z)

Source revision: https://substitutefor.net/entities/Q837?revision=885
