Todo Tower, animated React component
A to-do list stacked like bricks. Tick a task or drag it out sideways and the pile drops into the gap with a bounce; any brick left hanging too far over the one below tips off the edge.
- Pro
- Cards
- Spring
Play with it
Move the controls and watch it change. Copy code gives you a snippet with only the props you changed.
Call the landlord
Pay the invoice
Export the icons
Book the flights
Renew the domain
Reply to Nadia
Tick one, or drag one out sideways.
Props
| Prop | Type | Default | What it does |
|---|---|---|---|
| tasks | TodoTowerTask[] | TODO_TOWER_TASKS | Starting pile, top to bottom. Each task has text and x, its sideways offset in px. |
| moreTasks | string[] | TODO_TOWER_MORE | Labels the Add a task button drops onto the top of the pile, in turn. |
| overhang | number | 24 | How far (px) a brick may hang past the one beneath it before it tips off. |
| maxBricks | number | 8 | Most bricks the pile holds; adding does nothing past this. |
| onComplete | (text: string) => void | — | Called with a task's label when it is ticked off. |
| autoplay | boolean | false | Ticks tasks off and adds new ones by itself until someone touches the pile. |