Zustand vs Jotai Comparison

Minimal store-based state, ~1KB bundle

VS
Jotai

Atomic state management, Recoil evolution

8 min readFrontend

Quick Verdict

For simple global state and a minimal API, choose Zustand. For fine-grained derived state, Suspense integration, and more complex needs, choose Jotai. Both come from the same author and are complementary rather than competing. Zustand covers about 80% of use cases, while Jotai shines in the niche of derived state.

ZustandJotai
Read the full verdict

Score Comparison

Loading chart...

Detailed Scoring

Detailed Scoring: Zustand and Jotai — category-by-category scores out of 10
CategoryZustandJotai
Performance
10/10
9/10
Ease of Learning
10/10
7/10
Ecosystem
9/10
8/10
Community
9/10
8/10
Job Market
8/10
6/10
Future-Proof
9/10
9/10

Pros & Cons

Zustand

Pros

  • ~1KB bundle — the smallest of the two
  • Familiar hook-based API
  • No Provider wrapper needed — a standalone store
  • Built-in persist middleware (localStorage)
  • Compatible with Redux DevTools
  • First-class TypeScript support
  • Minimal boilerplate
  • Created by the well-respected Daishi Kato

Cons

  • The store is global — splitting it logically is a manual effort
  • Reactive dependencies are less fine-grained
  • Derived state is harder to model than in Jotai
  • Larger apps require you to establish your own scaling patterns

Best For

Small to medium-sized React appsMigrating from Redux to a simpler alternativeTeams that prefer a single-store mental modelPerformance-critical projects (tiny bundle)Rapid prototyping

Jotai

Pros

  • Atom-based model for fine-grained reactivity
  • Derived atoms make computed state feel natural
  • Native Suspense integration
  • Async atoms backed by Promises
  • Scope support for multiple contexts
  • Excellent TypeScript support
  • Created by Daishi Kato, the same author as Zustand
  • Compatible with React 19 concurrent features

Cons

  • The atom mental model has a learning curve
  • Larger bundle than Zustand (~5KB)
  • DevTools support is less mature
  • Architectural decisions can get complex

Best For

Complex derived stateFine-grained component updatesSuspense-heavy applicationsDevelopers who favor functional programmingTeams migrating from Recoil

Code Comparison

Zustand
import { create } from 'zustand';

const useUserStore = create((set) => ({
    user: null,
    fetchUser: async (id) => {
        const user = await api.getUser(id);
        set({ user });
    }
}));

// Usage
function Profile() {
    const { user, fetchUser } = useUserStore();
    return <div>{user?.name}</div>;
}
Jotai
import { atom, useAtom } from 'jotai';

const userAtom = atom<User | null>(null);
const userNameAtom = atom((get) => get(userAtom)?.name ?? "Guest");

function Profile() {
    const [user] = useAtom(userAtom);
    const [name] = useAtom(userNameAtom);  // Derived, fine-grained
    return <div>{name}</div>;
}

Conclusion

For simple global state and a minimal API, choose Zustand. For fine-grained derived state, Suspense integration, and more complex needs, choose Jotai. Both come from the same author and are complementary rather than competing. Zustand covers about 80% of use cases, while Jotai shines in the niche of derived state.

Get Free Consultation
FAQ

Frequently Asked Questions

Redux remains entrenched in enterprise ecosystems and legacy projects. For new projects, Zustand or Jotai is the default choice.

Related Blog Posts

View All Posts

Related Projects

View All Projects
All Comparisons