Task progress

Tracks long-running work with phases, honest progress, cancellation, and retry.

Export preview

In progress

Exporting study

In progress

12s elapsed

  1. Prepare · complete
  2. Render · active

Use it for

  • Exports, uploads, background processing, and recoverable operations.

Not for

  • A brief loading indicator; use Spinner.

Three ways in. They share one source, so the pixels match whichever you pick.

1. Import the package

npm install @noorddev/vlak-react

// once, next to your app's root
import "@noorddev/vlak-react/css";

import { TaskProgress } from "@noorddev/vlak-react";

Precompiled React and one stylesheet. No compiler to configure. Per-component imports work too: @noorddev/vlak-react/components/task-progress.

2. Vendor the source

npx @noorddev/vlak-cli add task-progress

The StyleX leaf lands in components/vlak/ with its dependencies, for your own compiler to own. See StyleX.

3. Through shadcn

npx shadcn add https://vlak.dev/r/task-progress.json

The same registry item, installed by shadcn's CLI.

CSS only

<link rel="stylesheet" href="node_modules/@noorddev/vlak/css/vlak.css" />

No React. Link vlak.css and use the markup and classes below.

import { TaskProgress } from "@noorddev/vlak-react";

<TaskProgress label="Exporting study" state="running" value={42} elapsedSeconds={12} phases={[{ id: "prepare", label: "Prepare", state: "complete" }, { id: "render", label: "Render", state: "active" }, { id: "package", label: "Package", state: "pending" }]} />

TaskProgress

Honest long-running task state, including unknown progress and action failures.

PropTypeDefaultDescription
labelrequiredstring
staterequiredTaskState
valuenumberPercentage, omit while the amount of work is unknown.
phasesTaskPhase[][]
descriptionReactNode
elapsedSecondsnumber
remainingSecondsnumber
onCancel() => void | Promise<void>
onRetry() => void | Promise<void>

Also accepts HTMLAttributes<HTMLElement>.

KeysDoes
Tab, Enter, SpaceTab reaches cancel or retry when supplied; Enter or Space invokes the callback.
<section class="rs-task-progress" aria-label="Exporting study"><h2 class="rs-task-progress-title">Exporting study</h2><p role="status">In progress</p><progress class="rs-task-progress-bar" aria-label="Export progress" max="100" value="42"></progress></section>
.rs-task-progress.rs-task-progress-title.rs-task-progress-bar.rs-task-progress-detail.rs-task-progress-phases.rs-task-progress-phase.rs-task-progress-actions