Zustand Store Architecture

Design and implement Zustand stores with proper typing, middleware, and best practices.

6/11/2026
Prompt
I need help setting up Zustand for state management in my React app.

**Application State Needs:**
```
[describe your state structure]
```

**Actions Required:**
[List the actions/mutations needed]

**Async Operations:**
[Describe API calls or async actions]

**Persistence:**
- LocalStorage: [yes/no]
- Session persistence: [yes/no]

**Requirements:**
- TypeScript: [yes/no]
- DevTools integration: [yes/no]
- Multiple stores: [yes/no]

Please provide:
1. Store definition with TypeScript
2. Actions and selectors
3. Async action patterns
4. Middleware setup (persist, devtools)
5. Store slicing pattern if needed
6. Component usage examples
7. Testing approach

Or press ⌘C to copy

Ready to use?

Copy and paste into your favorite AI tool

Works With

Test this prompt live

Try it in our AI Playground with Claude

Open Playground

Explore more Coding prompts

Browse Coding

Command Palette

Search for a command to run...