ChecklistItem
A todo row with a three-step check: the outline erases itself, a coloured square grows in, then the tick draws. The label strikes through and the row wiggles. Unchecking plays it backwards.
Preview
Installation
npx @codewithrabby/ui@latest add checklist-itemUsage
import { ChecklistItem } from "@/components/uir/checklist-item";
// uncontrolled
<ChecklistItem label="Buy groceries" defaultChecked />
// controlled
<ChecklistItem
label={todo.title}
checked={todo.done}
onCheckedChange={(done) => updateTodo(todo.id, done)}
/>Props
| Prop | Type | Default |
|---|---|---|
labelRow text. | string | — |
checkedControlled state. Pair with onCheckedChange. | boolean | — |
defaultCheckedStarting state when uncontrolled. | boolean | false |
onCheckedChangeCalled when the row is tapped. | (checked: boolean) => void | — |
colorFill colour of the checked box. | string | "#0a7aff" |
textColorLabel colour. | string | "#1d1d1f" |
doneTextColorLabel and strike colour once checked. | string | "#a1a1a6" |
outlineColorOutline of the empty box. | string | "#b9b9be" |
shakeWiggle the row when checked. | boolean | true |
fontSizeLabel size. | number | 15 |