A React hooks library for building performant forms with state management and validation, for web and React Native.
pmndrs/zustand
A small, hook-based state-management library for React with no providers required.
Open-source alternative to:Redux
- Stars
- 58,845
- Forks
- 2,176
- Open issues
- 8
- Last commit
- 7 days ago
What is it?
Zustand is a state-management library for React built on simplified flux principles. A store is created with a single function and exposed as a hook, so components can read any slice of state directly without wrapping the app in context providers.
Components subscribe to the parts of state they select and re-render only when those values change. The library includes helpers for shallow comparison, custom equality checks, and transient updates that avoid re-rendering. It also works without React through a vanilla store API.
The package provides middleware for persisting state to storage, Immer-based immutable updates, Redux-style reducers, and Redux DevTools integration. It is written in TypeScript and is available on npm.
Key features
- 01Creates stores as hooks with no provider required.
- 02Components re-render only when their selected state changes.
- 03Supports shallow comparison and custom equality functions.
- 04Offers persist, Immer, Redux-style and devtools middleware.
- 05Can be used without React via a vanilla store API.
Use cases
- Sharing application state across React components with minimal boilerplate.
- Persisting user preferences or session data to localStorage or sessionStorage.
- Migrating from Redux while keeping reducer-style actions.
- Managing frequently updating state without causing unnecessary re-renders.
Quick start
- 1
Install zustand from npm
npm install zustand - 2
Create a store with create and use the hook in components
Topics
FAQ
- What is zustand?
- A small, hook-based state-management library for React with no providers required. Zustand is a state-management library for React built on simplified flux principles. A store is created with a single function and exposed as a hook, so components can read any slice of state directly without wrapping the app in context providers.
- Is zustand free to use? What license does it have?
- zustand is open source under the MIT license. Check the license terms before using it in commercial products.
- Is zustand still maintained?
- Actively maintained. The last commit to zustand was on Oct 14, 2026.
- What can I use zustand for?
- Sharing application state across React components with minimal boilerplate. Persisting user preferences or session data to localStorage or sessionStorage. Migrating from Redux while keeping reducer-style actions. Managing frequently updating state without causing unnecessary re-renders.
- How do I install zustand?
- Install zustand from npm: npm install zustand Create a store with create and use the hook in components
- Where can I get zustand?
- The source code and installation instructions are on GitHub: https://github.com/pmndrs/zustand
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
Async state management and data fetching library for web apps, with bindings for React, Vue, Svelte and Solid.
A React Hooks library for data fetching that returns cached data first, then revalidates it in the background.
A React UI component library built on React Aria and Tailwind CSS v4, formerly known as NextUI.
An open-source virtual whiteboard for sketching hand-drawn style diagrams, with an embeddable React npm package.
A long-running list of ReactJS interview questions with answers, covering core React, Router, Redux, testing and React Native.