Welcome to the Jotai documentation! Jotai is a primitive and flexible state management library for React. It takes a bottom-up approach with an atomic model inspired by Recoil.
- Minimal API
- TypeScript oriented
- Tiny bundle size (3kb)
- Many extra utils and official integrations
- Supports Next.js and React Native
npm install jotai or
yarn add jotai
Learn the basic concepts and primitives of the library, discover how it compares with other solutions, and see examples of it in use.
These guides can help with common use cases such as async behavior, TypeScript, and Next.js.
Jotai has a very minimal API, exposing only a few exports from the main
jotai bundle. Each is explained in more detail in the Core doc. Jotai also has a nice devtool for debugging and a few helpful Babel plugins.
Jotai also includes a
jotai/utils bundle with a variety of extra utility functions. One example is
atomWithStorage, which includes localStorage persistence and browser tab synchronization.
Jotai has separate bundles for many official integrations including
atomWithQuery for React Query and
atomWithMachine for XState, among many others.
These recipes can help with more advanced patterns.