Todo List Manager

Medium
Free
#State Management

Implement a todo list component that allows users to add new todos, delete existing ones, and mark them as complete. The component should maintain a list of todos with their completion status and provide appropriate controls for managing them. Your implementation should demonstrate proper state management and event handling in React.

Requirements

  • Implement an input field with data-testid="todo-input" and a button with data-testid="add-button" to add new todos. The input should clear after adding a todo.
  • Each todo item should display its text and have a checkbox with data-testid="todo-checkbox-{id}" to toggle completion status.
  • Implement a delete button with data-testid="todo-delete-{id}" for each todo that removes it from the list.
  • Display the number of incomplete todos in data-testid="todo-count" with format "{count} items remaining".
  • The add button should be disabled when the input is empty.

Concepts you'll practice