Valtio vs Zustand
Which should you use? A side-by-side look at what each one does, who it suits, what it costs, how hard it is to set up, and where each falls short.
Open source · MIT
A small state library for React and plain JavaScript where you change state like a normal object.
Open source · MIT
A small React state-management library built on hooks, with no providers needed.
The short answer
Choose Valtio if you need…
- React developers who want simple shared state without a lot of boilerplate
- Developers who prefer mutating state directly instead of writing reducers or immutable updates
- Projects that need state outside components, subscribed to by plain JavaScript code
- Teams using React 19 who want to read async data with the use hook inside Suspense
Choose Zustand if you need…
- React developers who want simpler shared state than Redux
- Apps that need state shared across many components without wrapping them in providers
- Projects that need to read or update state outside components via getState and setState
- Developers who want fine control over which state changes trigger re-renders
Side-by-side
| Valtio | Zustand | |
|---|---|---|
| Type | Library | Library |
| Price | Free and open source | Free and open source |
| Licence | MIT | MIT |
| GitHub stars | 10.2k | 58.9k |
| Setup difficulty | Intermediate | Beginner |
| How you get it | Install with a package manager | Install with a package manager |
| Main language | TypeScript | TypeScript |
| Last code update | 7 days ago | 15 days ago |
What each one is
Valtio
Valtio lets you wrap a JavaScript object in a proxy, then change its properties directly from anywhere in your code. React components that read the state re-render only when the specific parts they use have changed. It works with React and also with plain JavaScript through a vanilla entry point.
Zustand
Zustand lets React apps keep shared state in a store that components read through a hook. Components subscribe to just the pieces they select and re-render only when those pieces change. The README says it needs no context providers and has a small API, and it can also be used without React.
Best for
Valtio
- React developers who want simple shared state without a lot of boilerplate
- Developers who prefer mutating state directly instead of writing reducers or immutable updates
- Projects that need state outside components, subscribed to by plain JavaScript code
- Teams using React 19 who want to read async data with the use hook inside Suspense
Zustand
- React developers who want simpler shared state than Redux
- Apps that need state shared across many components without wrapping them in providers
- Projects that need to read or update state outside components via getState and setState
- Developers who want fine control over which state changes trigger re-renders
Strengths
Valtio
- Mutations look like normal JavaScript, so there is little new syntax to learn
- Components re-render only for the state they actually read, according to the README
- Works in React and in vanilla JavaScript from the same core idea
Zustand
- Small, simple API based on hooks, with no providers required
- Components re-render only when the selected state they read changes
- Works with async actions and can be used outside React
Not ideal for
Valtio
- Developers who want strictly immutable, reducer-based state, since Valtio uses mutation and snapshots instead
- Beginners who are not yet comfortable with proxies, as the README notes the snapshot and proxy split can be confusing at first
- Apps that need Suspense with useTransition to work smoothly, because the README says that pattern suffers from de-opt issues
Zustand
- Teams that require Redux's conventions, tooling, and strict structure, since the README describes zustand as un-opinionated
- Projects not using React or JavaScript, since the README focuses on JavaScript and React usage and the vanilla core is only a secondary option
- Adding state inside React Server Components, which the README explicitly advises against because it can cause bugs and privacy issues
Trade-offs
Valtio
- Its TypeScript types for useSnapshot can be stricter than some users want, and the README points to a workaround
- The README notes that this in methods can behave unexpectedly, so arrow functions are recommended
- Suspense with use still has a de-opt issue that affects useTransition, with a third-party library suggested as a workaround
Zustand
- The README says to set state immutably and be careful when replacing state, which takes care to get right
- Some patterns, such as fetching everything or using custom equality, can cause extra re-renders or require extra setup
- Documentation for the migration to v5 and TypeScript usage is referenced but not included in the truncated README
Getting started
Frequently asked questions
What is the difference between Valtio and Zustand?
Valtio: A small state library for React and plain JavaScript where you change state like a normal object. Zustand: A small React state-management library built on hooks, with no providers needed. Valtio suits react developers who want simple shared state without a lot of boilerplate, while Zustand suits react developers who want simpler shared state than redux.
Are Valtio and Zustand free?
Valtio: Free and open source. Zustand: Free and open source.
Which is easier to set up, Valtio or Zustand?
Zustand is easier to get started with (rated beginner); Valtio is rated intermediate and usually needs more setup.
Is Valtio or Zustand more popular?
Zustand has more GitHub stars (58.9k) than Valtio (10.2k). Popularity isn't the same as fit — check which one matches your use case above.
What are other alternatives to Valtio and Zustand?
Other options people compare them with include Jotai, Redux Toolkit, MobX, XState, Redux.
Keep comparing
Built from our catalogue entries for both products: open-source details come from each project's README (AI-assisted, refreshed weekly) and GitHub data; AI-tool details are editorial. Spotted something wrong? Let us know from either product's page.