TaskProgress
Make a multi-stage operation legible, including partial completion and failure.
Live — this one is real
Prepare release33%
- Validatecomplete
- BuildrunningCompiling package
- Publishqueued
Usage
import { useState } from "react";
import { TaskProgress } from "mizu-ui";
export function Example() {
const [cancelled, setCancelled] = useState(false);
return (
<TaskProgress
label="Prepare release"
onCancel={() => setCancelled(true)}
steps={[
{ id: "a", label: "Validate", state: "complete" },
{
id: "b",
label: "Build",
state: cancelled ? "error" : "running",
detail: cancelled ? "Cancelled by you" : "Compiling package",
},
{ id: "c", label: "Publish", state: "queued" },
]}
/>
);
}
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 status/Feedback.tsx
Source is included in the npm package under src/status/Feedback.tsx.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| steps | TaskStep[] | — | Stable id, label, state and optional detail. |
| onCancel | () => void | — | Shown while a step is running. Consumer cancels the real task. |
Accessibility
Ordered steps expose readable states. Progress counts completed steps; error text does not rely on color.
Motion
CSS transitions explain state changes. Reduced motion removes travel.