To-Do With Filter Tabs

EasyStateComponentsReact25 mins

by Pratik Rai

Read the full write-up

A task list with three tabs: In progress, Completed and Deleted.

The third tab is what makes this more than a to-do list — a deleted task still has to be listed somewhere, so deletion cannot mean removal.

Requirements

  1. Typing a title and pressing Enter, or clicking Add, appends a task. Blank titles are ignored and the input clears.

  2. Each tab shows only the tasks in that state.

  3. A task can be completed and un-completed with its checkbox.

  4. Deleting a task moves it to the Deleted tab rather than removing it, and it can be restored from there.

  5. Each tab shows how many tasks it holds.

Notes

  • A deleted task has no checkbox — it is out of the workflow until restored.

  • The styling is written: .task-done and .task-deleted handle the two variants.

Hints

Loading editor…