Jotai manages React application state through small atoms instead of string-keyed stores. It offers a minimal core API, derived and async atoms, and optional utility packages.
Overview
Jotai gives React teams a granular way to hold and share UI state. Each atom wraps an initial value that may be a primitive, object, or array, and components subscribe with hooks similar to useState.
Derived atoms read other atoms through a getter to produce computed values, including combinations of multiple sources. Read functions can be asynchronous, and writable derived atoms add setter logic for updates that propagate back to base atoms.
The design avoids string-based atom keys, which the project contrasts with Recoil-style naming. Optional extensions expand the core for larger TypeScript codebases while keeping the base bundle small.
Documentation and demos on the project site show patterns for write-only atoms, async write actions, and functional composition. The package installs from npm for use inside standard React rendering trees.
Key features
- Primitive and derived atoms
- Async read and write atoms
- Hook-based component subscriptions
- No string atom keys
- Small minimal core bundle
- Writable computed atoms
- Write-only atom support
- Extension utility packages
Use cases
- Component-local React state sharing
- Derived UI values from multiple atoms
- Async data tied to atom updates
- TypeScript React application state