Checklist widget (Pro)
ProIncluded in $99Steps an assistant laid out, to tick off in the chat, with a progress bar of one segment per step and drag to reorder.
On this page
Installation
Needs chatcn Pro
This command works with a Pro license, along with every Pro component.
Or start free: sign up and get three Pro components on us, with a new one every month.
Usage
import { ChecklistWidget } from "@/components/ui/chatcn/pro/checklist-widget"
<ChecklistWidget
title="Before you fly"
meta={["Tokyo", "Friday"]}
defaultItems={[
{ id: "passport", label: "Check your passport", done: true },
{ id: "esim", label: "Buy an eSIM", detail: "Install it before you fly" },
]}
onItemsChange={save}
addable
/>The bar under the title has a segment per step in step order, so progress reads as which steps, not only how many. Ticking a step draws its check left to right and fills its segment; when the last one is ticked the bar, the boxes and the count turn green. Drag a step by its handle, which shows on hover and always on touch, and the steps it passes slide aside; or focus the handle and use the arrow keys, or press Alt with the arrow keys on a step. Moves are announced. reorderable={false} keeps a fixed order for steps that must run in sequence. addable adds a field at the end.
Examples
States
Props
| Prop | Type | Notes |
|---|---|---|
items, defaultItems, onItemsChange | ChecklistItem[] | { id, label, detail?, done? } |
title, meta | The header; the count sits beside it | |
reorderable | boolean | Default true |
addable | boolean | A field to add steps |
labels | Partial<ChecklistWidgetLabels> | Every string, for translation |
Keyboard
| Key | Action |
|---|---|
| Space | Tick or untick a step |
| Arrow up, down on a handle | Move the step |
| Alt and arrow up, down on a step | Move the step |
| Enter in the field | Add the step |
Accessibility
- Steps are real checkboxes inside labels.
- Handles are buttons named for their step; every move is announced in a polite live region.
Motion
Checks draw in with clip-path over 300 ms and segments fill with scale. Passed steps slide with translate. Under reduced motion they change in place.