Checklist

A read-only list of checks: each row a mark and a label, met, open or optional.

Installation

$
npx shadcn@latest add https://ui.mattdowney.com/r/checklist.json

Usage

import { Checklist, ChecklistItem } from "@/components/ui/checklist"

Examples

Default

Met is a filled success tick, open an empty ring. The mark sits on the first line of a label that wraps. Screen readers hear the state in words before each label.

  • Done: Has a name people will recognise
  • Done: Says when it should be used
  • Not done: Gives at least one example of the result it should produce, so the reader can tell a good answer from a close one

Optional nudges

optional draws a dashed ring for a suggestion that is not scored. Give them their own list with tone="subtle", so they read softer than the checks above.

  • Done: Domain points at your store
  • Not done: Certificate issued
  • Optional: Redirect www to the bare domain

Sizes

Pick the size of the text around the list. The mark stays 14px at every size.

  • Done: sm: done
  • Not done: sm: not yet
  • Done: default: done
  • Not done: default: not yet
  • Done: lg: done
  • Not done: lg: not yet

API Reference

PropTypeDefaultDescription
sizeChecklist"sm" | "default" | "lg""default"Label type: 12, 13 or 14px. The mark stays 14px.
toneChecklist"muted" | "subtle""muted"muted for scored checks, subtle for a list of optional nudges.
state*ChecklistItem"met" | "open" | "optional"NoneMet: a filled success disc with a tick. Open: an empty ring. Optional: a dashed ring, for an unscored suggestion.
sizeChecklist"sm" | "default" | "lg" = "default"Label type: 12, 13 or 14px. The mark stays 14px.
toneChecklist"muted" | "subtle" = "muted"muted for scored checks, subtle for a list of optional nudges.
state*ChecklistItem"met" | "open" | "optional"Met: a filled success disc with a tick. Open: an empty ring. Optional: a dashed ring, for an unscored suggestion.