Frontend · Library

Zustand

A small, simple library for sharing state between React components, with a store you create in a few lines and read with a hook.

State and data · Open source · updated

How it works

You call create() with the starting values and the functions that change them, and get back a hook. Any component can call that hook and pick just the slice it needs, so it re-renders only when that slice changes. There is no provider to wrap the app in and very little boilerplate.

Middleware adds saving to localStorage (persist), Redux DevTools support and Immer-style updates. Zustand comes from the Poimandres collective (pmndrs), which also makes Jotai and React Three Fiber. It suits client state such as settings, carts and UI toggles; data fetched from a server is usually better handled by TanStack Query.

Zustand pros and cons

Pros

  • Tiny, with almost no boilerplate
  • No provider needed, and stores work outside React components too
  • Components re-render only for the values they select
  • Easy to persist to storage and inspect in Redux DevTools

Cons

  • Few rules, so large apps need their own conventions
  • Not built for caching server data (pair it with TanStack Query)

When to use Zustand

Pick it when

  • Shared client state in small to large React apps
  • Replacing heavy context setups or a Redux store that feels like overkill

Skip it when

  • A large team that wants strict, enforced patterns (Redux Toolkit)
  • The state is really server data

Zustand pricing

Open source

Free (MIT).

Approximate, checked September 2026.What the other tools cost

Zustand vs the alternatives

More in Frontend

State and data

All 26 Frontend terms

Crafted in the dark. Shipped to the world.

Tell us what you are building. You get a private project space with a proposal and a line-by-line quote within a day.