Todo Tower
betaTo-do cards stacked like bricks: tick one and it flicks away as the cards above drop; drag one and the stack sways.
- Display
- 1 file
- 2 npm packages
- Accessibility notes
- Animates with motion
Loading the example…
pnpm dlx @dowel-ui/cli add todo-towernpm packages installed: class-variance-authority, motion.
import { TodoTower } from "@/components/ui/todo-tower";Default
Gallery
<TodoTower>
| Prop | Type | Default |
|---|---|---|
checkLabelThe check button's name for a to-do. | (label: string) => string | (text) => `Done: ${text}` |
completedLabelAnnounced when a to-do is completed. | (label: string) => string | (text) => `Completed: ${text}` |
defaultItemsInitial to-dos when uncontrolled, top of the stack first. | TodoItem[] | [] |
fill | "light" | "dark" | "light" |
gravityHow hard the stack pulls back together, 0–100. | number | 50 |
itemsControlled to-dos, top of the stack first. | TodoItem[] | — |
labelThe list's accessible name. | string | "To-dos" |
loopRe-drop the whole stack once the last card is done (uncontrolled only). | boolean | false |
onCompleteCalled with the to-do that was completed. | (item: TodoItem) => void | — |
onItemsChangeCalled with the remaining to-dos after one is completed. | (items: TodoItem[]) => void | — |
slipHow loosely the cards above a held one sway, 0–100. | number | 45 |
stroke | boolean | — |
Plus every attribute of <div> except defaultValue, onChange.
A labelled list. Each card's check is a real button named "Done: <task>", so Tab and Enter/Space complete tasks; completion is announced politely and focus moves to the card that drops into the gap. Dragging and swaying the stack is decoration with no keyboard equivalent because it does nothing. Under reduced motion there is no sway, flick or drop.
10/10
checks passed
- Tested — passes
- axe assertion — passes
- Keyboard tested — passes
- Storybook examples — passes
- Accessibility documented — passes
- Semantic tokens only — passes
- Motion from tokens — passes
- className merged — passes
- Visible focus — passes
- No fixed widths — passes