A simple task management application built with React and Zustand to demonstrate state management capabilities.
- Add, toggle, and delete tasks
- Filter tasks by status (all, active, completed)
- Clear all completed tasks
- Modern and responsive UI
- Efficient state management with Zustand
- React
- Zustand (for state management)
- CSS3 (modern styling)
- Node.js (v14 or higher)
- npm (v6 or higher)
- Clone the repository
git clone https://github.com/yourusername/zustand-demo.git
- Navigate to the project directory
cd zustand-demo
- Install dependencies
npm install
- Start the development server
npm start
The application will open in your default browser at http://localhost:3000
.
zustand-demo/
├── src/
│ ├── store/
│ │ └── useStore.js # Zustand store configuration
│ ├── App.js # Main application component
│ ├── App.css # Styles
│ └── index.js # Entry point
├── public/
│ └── index.html
└── package.json
-
Adding Tasks
- Type your task in the input field
- Press Enter or click "Add Task"
-
Managing Tasks
- Click the checkbox to toggle task completion
- Click the delete button to remove a task
-
Filtering Tasks
- Use the filter buttons to show all, active, or completed tasks
- Click "Clear Completed" to remove all completed tasks
This project demonstrates several key Zustand concepts:
- Creating a store with
create
- Managing state with actions
- Accessing state in components
- Updating state immutably
- Deriving state (filtered tasks)
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Zustand - Simple state management
- React - UI library
- Create React App - Project bootstrapping