UIR

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-item

Usage

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

PropTypeDefault
label

Row text.

string—
checked

Controlled state. Pair with onCheckedChange.

boolean—
defaultChecked

Starting state when uncontrolled.

booleanfalse
onCheckedChange

Called when the row is tapped.

(checked: boolean) => void—
color

Fill colour of the checked box.

string"#0a7aff"
textColor

Label colour.

string"#1d1d1f"
doneTextColor

Label and strike colour once checked.

string"#a1a1a6"
outlineColor

Outline of the empty box.

string"#b9b9be"
shake

Wiggle the row when checked.

booleantrue
fontSize

Label size.

number15