On this page
Overview
Zustand is a small state-management library for React. create builds a store hook, components select only the state they need, and optional middleware adds persistence, devtools integration, selector subscriptions, and other behavior.
Features and best fit
Based on official documentation; not hands-on tested · Content checked:
Key features
Create stores as hooks without a required provider
Passing state and actions to create returns a store hook that components can call directly. Basic usage does not require wrapping the application in a Context Provider.
Sources: [2]
Use selectors and middleware to control subscriptions and behavior
Selectors subscribe components to specific state slices, while useShallow can reduce rerenders for grouped selections. Middleware includes persistence, devtools, and selector-aware subscriptions.
Sources: [2]
Best fit
Fits React applications that need concise shared client state
It works well for shared form state, cross-screen UI state, and client-side application state when teams want less boilerplate than reducer-heavy approaches. A vanilla store is also available without React.
Sources: [2]
Before adoption
Replacing the whole state can also remove actions
Passing true as the second argument to set replaces rather than merges the state, which can remove action functions stored alongside data. Whole-state replacement needs deliberate preservation of required fields.
Sources: [2]
Avoid sharing module-level stores across React Server Component requests
The README warns that adding shared state through this pattern in React Server Components can cause unexpected behavior and privacy issues. Server-rendered applications need request-aware store boundaries.
Sources: [2]
Official sources
- [1]pmndrs/zustand repository(2026-09-30)
- [2]Zustand README(2026-09-30)
- [3]Zustand package metadata(2026-09-30)
- [4]Zustand MIT license(2026-09-30)
Supplemental curator note
It starts with very little ceremony, but selector design and store boundaries directly affect rerenders and SSR/RSC safety. Server Components require careful request isolation instead of a shared module-level store.
Try it in 3 steps
- 1
Install Zustand
Add Zustand to an existing React project using the command documented in the README.
npm install zustand - 2
Create a store hook
After importing create from zustand, define a minimal store with state and an action.
const useBearStore = create((set) => ({ bears: 0, increase: () => set((state) => ({ bears: state.bears + 1 })) })) - 3
Subscribe to only the state a component needs
Use a selector for the required value and read actions from the same store hook when wiring UI interactions.
const bears = useBearStore((state) => state.bears)
Growth
Growth trends · Last 30 days
58,774 Stars
Trend data is still being collected.
Development activity
Last 90 days · weekly
- Commits (last 30 days)
- 1
- Open PRs
- 5
Development activity is still being collected.
Built with
Categories and tags
Categories
GitHub data
GitHub dataView detailed GitHub data
GitHub Topics
- hooks
- react
- react-context
- reactjs
- redux
- state-management
- hacktoberfest
- Stars
- 58,774
- Forks
- 2,192
- Watchers
- 202
- Open issues
- 2
- Contributors
- 337
- Owner type
- Organization
- Primary language
- TypeScript
- License
- MIT
- Repository last updated
- Sep 29, 2026
Related information
Write a related articleShare a guide or use case for this OSS in Markdown. Articles are published after administrator approval.
Explore next
- TanStack Query50,383 Stars
2 shared tag(s) · 2 shared category(s) · Same language
Manage fetching, caching, refetching, and mutations for remote server state outside local UI-state code
TypeScript - React Hook Form44,866 Stars
2 shared tag(s) · 2 shared category(s) · Same language
Manage React input registration, validation, submission, and dynamic fields through hooks
TypeScript - tRPC40,677 Stars
2 shared tag(s) · 2 shared category(s) · Same language
Carry server types to clients and catch API mismatches during development
TypeScript - Chakra UI40,674 Stars
2 shared tag(s) · 2 shared category(s) · Same language
Combine React components, Ark UI primitives, and design tokens in one accessible design system
TypeScript - CopilotKit37,609 Stars
2 shared tag(s) · 2 shared category(s) · Same language
embed agent conversation, generative UI, and shared action in a product
TypeScript - Expo52,489 Stars
4 shared tag(s) · 2 shared category(s) · Same language
build React Native apps for Android, iOS, and web from one project model
TypeScript
Report incorrect information
Tell us if any listing information is incorrect or outdated.