Checklist
ProThe onboarding panel: a card that tracks a short list of setup tasks and their progress. The bar and the 3-of-6 read-out derive from value and total, and the bar turns green the moment every step is done.
Installation#
Usage#
The preview is yours to explore. Its code comes with a Pro license, paid once and used in every project.
Have a license? Unlock it here
Anatomy#
import {
Checklist,
ChecklistHeader,
ChecklistTitle,
ChecklistDescription,
ChecklistProgress,
ChecklistItems,
ChecklistItem,
ChecklistItemContent,
ChecklistItemTitle,
ChecklistItemDescription,
ChecklistItemAction,
} from "@/components/ui/checklist"
<Checklist>
<ChecklistHeader>
<ChecklistTitle />
<ChecklistDescription />
<ChecklistProgress />
</ChecklistHeader>
<ChecklistItems>
<ChecklistItem>
<ChecklistItemContent>
<ChecklistItemTitle />
<ChecklistItemDescription />
</ChecklistItemContent>
<ChecklistItemAction />
</ChecklistItem>
</ChecklistItems>
</Checklist>Item states#
Every ChecklistItem carries a status, drawn by the one task mark every task list in the kit shares: 16px, centred on the title's first line. A complete row fills it with ink and a tick and de-emphasizes the title; active marks the one recommended next step with an ink ring half filled, started but not done, and the primary action; the row stays flat, so the button is what draws the eye. todo rows wait quietly with an empty ring and an outline action.
Progress & completion#
Pass value (completed count) and total to the root; ChecklistProgress derives the bar, the “X of Y” label and the percentage itself. When every step is done the bar eases from ink to success-green and the label swaps to All steps complete.
Density#
Like Card and Dialog, the Checklist reads the density context (or a density prop). Density tunes the card and row padding only, and it is compact unless set. The indicator footprint is fixed at both densities, so the left rail lines up identically.
Tasks the reader ticks#
Give a ChecklistItem checked and onCheckedChange (or defaultChecked to let it keep its own state) and it becomes a task list: the indicator turns into the task mark, a real checkbox drawn like the small Checkbox only round, 16px and centred on the title's first line, with a tick in the colour of the surface beneath. It is named by the item's title, the whole row is its hit area, and a ticked title is struck through as it mutes. Leave value and total off the root and the Checklist counts its own items, so the bar follows every tick with no wiring. A row's ChecklistItemAction stays its own target above the hit area.
Inside a Card#
variant="plain" drops the Checklist's own contour and outer padding, so it sits inside a Card (or any surface that already frames it) without a frame inside a frame. The Card's header carries the heading; the indicators line up with it, and the row pills bleed into the Card's padding the way List's plain rows do. ChecklistProgress can lead the header on its own.
The task mark on its own#
ChecklistMark draws the same mark without the Checklist around it, for a task list something else lays out: the steps of an Accordion, a row that is already a button. An empty ring while the task waits, an ink ring half filled on the active step, the ink fill with a tick once it is complete: fill only ever means done. It centres itself on a text-sm first line, so put it in an items-start row. It is decoration, so the row says the state in words.
API reference#
Checklist
The root panel; owns the progress its parts read. Forwards all native <div> props. Every part accepts className, merged last.
| Prop | Type | Default | Description |
|---|---|---|---|
| value | number | - | Completed tasks. Leave it out and the Checklist counts its complete rows. Clamped to total. |
| total | number | - | All tasks. Leave it out and the Checklist counts its rows. |
| variant | "card" | "plain" | "card" | The ring-edged panel, or no contour and outer padding, for a Checklist inside a Card. |
| density | "comfortable" | "compact" | "compact" | Card and row padding; the mark stays put. Falls back to the nearest DensityProvider. |
| asChild | boolean | false | Renders the panel onto its single child (Radix Slot). |
ChecklistHeader
The block holding the title, description and progress. Forwards all native <div> props.
ChecklistTitle
The panel heading, an <h3>. Forwards all native <h3> props.
| Prop | Type | Default | Description |
|---|---|---|---|
| asChild | boolean | false | Renders onto its single child, to change the heading level. |
ChecklistDescription
The muted line under the title, a <p>. Forwards all native <p> props.
ChecklistProgress
The labelled role="progressbar" bar, read from the root. Its fill turns success at 100%. Forwards all native <div> props.
| Prop | Type | Default | Description |
|---|---|---|---|
| label | React.ReactNode | "{value} of {total} complete" | The leading label. The default swaps to "All steps complete" with a check when done. |
ChecklistItems
The task list, a <ul>. Forwards all native <ul> props.
ChecklistItem
One task row, an <li> that draws its own mark and an sr-only status. Any of checked, defaultChecked or onCheckedChange makes it a row the reader ticks. Forwards native <li> props.
| Prop | Type | Default | Description |
|---|---|---|---|
| status | "todo" | "active" | "complete" | "todo" | The task state. On a row the reader ticks, checked decides complete. |
| checked | boolean | - | Ticked, controlled. The mark becomes a Radix checkbox named by the title; the whole row toggles it. |
| defaultChecked | boolean | - | Ticked on first render, uncontrolled. |
| onCheckedChange | (checked: boolean) => void | - | Called when the reader ticks or unticks the row. |
| Data attribute | Description |
|---|---|
| data-status | "todo", "active" or "complete", as resolved. |
| data-state | "checked" or "unchecked", on a row the reader ticks. |
ChecklistItemContent
The title and description column; grows so the action rides the right edge. Forwards all native <div> props.
ChecklistItemTitle
The task name; mutes when complete and strikes through when ticked. Names the checkbox. Forwards all native <div> props.
ChecklistItemDescription
The muted line under the task name. Forwards all native <div> props.
ChecklistItemAction
The trailing slot for a Button; stays its own target on a row the reader ticks. Forwards all native <div> props.
ChecklistMark
The task mark alone, aria-hidden, for task lists the Checklist does not lay out; needs no Checklist. Forwards all native <span> props.
| Prop | Type | Default | Description |
|---|---|---|---|
| status | "todo" | "active" | "complete" | "todo" | An empty ring, an ink ring half filled, or the ink fill with a tick. |
| Data attribute | Description |
|---|---|
| data-status | "todo", "active" or "complete". |
| data-state | "checked" when complete, else "unchecked". |