This project is a simple and intuitive Todo List application built with React, TypeScript, and CSS Modules. It allows users to add, update, and remove tasks, with completed tasks being displayed separately. The application also uses local storage to persist data between sessions.
- Add Todo: Add new tasks to your todo list.
- Update Status: Mark tasks as complete or incomplete.
- Remove Todo: Remove tasks from your list.
- Persist Data: Data is saved to local storage, ensuring your tasks are available even after refreshing the page.
- Error Handling: Prevent adding empty tasks with user-friendly error messages.
- React: A JavaScript library for building user interfaces.
- TypeScript: A statically typed superset of JavaScript that enhances developer productivity.
- CSS Modules: Scoped CSS to prevent class name collisions and keep styles maintainable.
- Local Storage: Web storage API to persist data across sessions.
src/
components/
AddTodo.tsx
AddTodo.module.css
ToDoList.tsx
ToDoList.module.css
types/
index.ts
App.tsx
App.module.css
index.tsx
- components/: Contains the
AddTodoandToDoListcomponents along with their respective styles. - types/: Contains TypeScript type definitions.
- App.tsx: The main application component.
- App.module.css: Scoped styles for the main application component.
- index.tsx: Entry point of the React application.
Make sure you have the following installed on your local development environment:
- Node.js
- npm or yarn
- Clone the repository:
git clone https://github.com/yourusername/todo-list-app.git
cd todo-list-app- Install dependencies:
npm install
# or
yarn installTo start the development server, run:
npm start
# or
yarn startThe application will be available at http://localhost:3000.
To create a production build, run:
npm run build
# or
yarn buildThe optimized build will be output to the build directory.
- Type your task into the input field.
- Click the "Add" button or press
Enter. - Your task will appear in the list.
- Click the "DONE" button next to the task.
- The task will move to the "Completed" section.
- Click the "REMOVE" button next to the task.
- The task will be removed from the list.
Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.
- Fork the repository.
- Create a new branch (
git checkout -b feature/your-feature). - Commit your changes (
git commit -m 'Add your feature'). - Push to the branch (
git push origin feature/your-feature). - Open a pull request.
This project is licensed under the MIT License. See the LICENSE file for more details.