A simple and responsive Todo List application built with React.js, Vite, Tailwind CSS, and React Context API.
The application allows users to add, edit, and delete tasks while automatically storing todo data in the browser using LocalStorage.
๐ View Live Demo
- โ Add new tasks
- โ๏ธ Edit existing tasks
- ๐๏ธ Delete tasks
- ๐พ Save tasks using LocalStorage
- ๐ Restore tasks after refreshing the browser
- โ๏ธ Global state management using React Context API
- ๐ SweetAlert2 notifications
- ๐จ Responsive user interface
- ๐ฑ Mobile-friendly layout
- โก Fast development and production build using Vite
- ๐ Deployed on Vercel
| Technology | Purpose |
|---|---|
| React.js | Building the user interface |
| Vite | Development server and build tool |
| JavaScript | Application logic |
| Tailwind CSS | Styling and responsive design |
| React Context API | Global state management |
| React Hooks | State and lifecycle management |
| LocalStorage | Persistent browser storage |
| React Icons | UI icons |
| SweetAlert2 | User notifications |
| Vercel | Deployment |
Todo-list/
โ
โโโ public/
โ โโโ image.png
โ โโโ home.png
โ โโโ logo.png.png
โ
โโโ src/
โ โโโ components/
โ โ โโโ AddTodo.jsx
โ โ โโโ AllTodo.jsx
โ โ
โ โโโ context/
โ โ โโโ ContextTodo.jsx
โ โ
โ โโโ App.jsx
โ โโโ main.jsx
โ โโโ index.css
โ
โโโ .gitignore
โโโ eslint.config.js
โโโ index.html
โโโ package.json
โโโ package-lock.json
โโโ vite.config.js
โโโ README.md
The user enters a task into the input field and clicks the add button.
The task is passed to the Context API:
addTodo(input)The input is then cleared after adding the task.
Todo data is managed through React Context API.
The context provides:
addTodo()
deleteTodo()
updateTodo()
todosThis allows different components to access and modify the todo state without passing props through multiple component levels.
The application stores todo data in the browser's LocalStorage.
The LocalStorage key is:
my_todos
Todo data is converted into JSON before being stored.
localStorage.setItem(
"my_todos",
JSON.stringify(todos)
)When the application starts, it checks LocalStorage for previously saved tasks.
localStorage.getItem("my_todos")If saved tasks are found, they are loaded into React state.
This allows tasks to remain available after refreshing the browser.
Users can click the edit button to modify an existing task.
After saving the change, the updated task is stored in React state and LocalStorage.
Users can delete an existing task using the delete button.
The task is removed from the todo state and the updated list is saved to LocalStorage.
This project demonstrates:
- Functional Components
useStateuseEffectuseContext- Context API
- Controlled Components
- Event Handling
- Conditional Rendering
- Component Composition
- State Management
- LocalStorage Integration
The application uses browser LocalStorage instead of a backend database.
Example:
[
"Learn React",
"Practice JavaScript",
"Build a project"
]Because the data is stored locally in the browser, it is specific to the user's browser/device.
The interface uses:
- Tailwind CSS
- React Icons
- Responsive layout
- Background image
- Blur/glass-style visual effects
- Scrollable todo container
- SweetAlert2 notifications
The application is designed for different screen sizes:
- ๐ป Desktop
- ๐ป Laptop
- ๐ฑ Tablet
- ๐ฑ Mobile
Clone the repository:
git clone https://github.com/naved2001/Todo-list.gitMove into the project directory:
cd Todo-listInstall dependencies:
npm installStart the development server:
npm run devOpen the local development URL provided by Vite.
npm run devnpm run buildnpm run previewnpm run lintThe application is deployed using Vercel.
๐ Live Demo:
https://todo-list-naved5.vercel.app/
The following features can be added in future versions:
- Mark tasks as completed
- Active / Completed / All filters
- Search tasks
- Task priority
- Due dates
- Categories
- Dark / Light theme
- Drag-and-drop task ordering
- User authentication
- Backend API
- Database integration
- Supabase integration
- Synchronization across multiple devices
Full Stack Web Developer
- GitHub: https://github.com/naved2001
- Portfolio: https://naved-ansari-portfolio.vercel.app/
- LinkedIn: https://www.linkedin.com/in/mohammad-naved-ansari/
This project is created for learning and portfolio purposes.
โญ If you found this project useful, feel free to explore the repository.
Made with โค๏ธ using React.js
