Repolode
pmndrs

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. 1

    Install zustand from npm

    npm install zustand
  2. 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