Skip to content

Checklist

Complete a set of real tasks and see how much remains.

Live — this one is real

Release checks1 / 3

Usage

import { useState } from "react";
import { Checklist } from "mizu-ui";

export function Example() {
  const [items, setItems] = useState([
    { id: "types", label: "Check types", checked: true },
    {
      id: "browser",
      label: "Review in the browser",
      description: "Include a narrow screen and keyboard navigation.",
      checked: false,
    },
    { id: "package", label: "Install mizu-ui", checked: false },
  ]);
  return (
    <Checklist
      label="Release checks"
      items={items}
      onChange={(id, checked) =>
        setItems(items.map((i) => (i.id === id ? { ...i, checked } : i)))
      }
    />
  );
}

Source & setup

Import mizu-ui/styles.css once. Fonts are optional via mizu-ui/fonts.css. Override --mizu-* tokens or use className for local styling. Uses native React and CSS; install the package peers for root imports.

Inspect content/Checklist.tsx

Source is included in the npm package under src/content/Checklist.tsx.

Open full source ↗

Props

PropTypeDefaultDescription
itemsChecklistItem[]—Stable id, label, description, checked and disabled.
onChange(id: string, checked: boolean) => void—Persist or update each task.
labelstring—Checklist legend.

Accessibility

Native fieldset/checkboxes with linked descriptions. Count is derived from supplied state; no automatic completion.

Motion

State changes remain stable; no layout travel.

Works alongside