# Progress

Progress bars and rings for active, paused and failed work.

Access: pro. Category: Feedback. Kind: primitive.

## When to use

- Use it when a product interface needs progress bars and rings for active, paused and failed work.
- Choose it when the host application can supply the required state and keep business logic outside the presentation component.

## Alternatives

- Choose alert instead when inline notices with icons, actions and optional dismissal is the actual interface need, rather than progress.

## Setup for agents

Use React 19 and TypeScript. Initialize shadcn for your framework, then merge this exact entry into components.json:

```json
{
  "registries": {
    "@tidal-pro": {
      "url": "https://tidalui.com/r/pro/{name}.json",
      "headers": {
        "Authorization": "Bearer ${TIDALUI_TOKEN}"
      }
    }
  }
}
```

The namespace must be named **@tidal-pro** because transitive Pro dependencies use that namespace. Obtain an agent key from your active Pro account at https://tidalui.com/account. Keep TIDALUI_TOKEN in your local environment, never in components.json, client code, Git or logs.

```sh
export TIDALUI_TOKEN='your-private-agent-key'
npx shadcn@latest add @tidal-pro/waitlist-form
npx shadcn@latest add https://tidalui.com/r/tidal-button.json
```

Free command: `npx shadcn@latest add https://tidalui.com/r/<name>.json`.
Pro command: `npx shadcn@latest add @tidal-pro/<name>`.

Import the base stylesheet and every stylesheet listed on the installed item's metadata. For example:

```tsx
import "./components/ui/tidal.css";
import "./components/ui/hero-section.css";
// Place installed components inside this wrapper:
<div className="tidal-scope" data-theme="dark">...</div>
```

Omit data-theme for the default light theme. Put the attribute on the same tidal-scope element for dark mode. Every component installs the shared free tidal-base dependency. After upgrading, run `npx shadcn@latest add https://tidalui.com/r/tidal-base.json --overwrite` to receive current tokens. Review local modifications before overwriting.

Vite: Use React + TypeScript. Map @/* to ./src/* in paths and Vite resolve.alias. Import tidal.css and each component stylesheet in your application entry.

Next.js 15 App Router: Next.js App Router: import tidal.css and component CSS in app/layout.tsx. Interactive examples belong in a client component with "use client". Map @/* to ./* or ./src/* to match your project.

TypeScript 6: use paths without baseUrl:

```json
{
  "compilerOptions": {
    "paths": {
      "@/*": [
        "./src/*"
      ]
    }
  }
}
```

Pro registry requests are server/CLI-only. Use the same-origin account interface in a browser; cross-origin Authorization preflights are intentionally unsupported.


## Install Progress

```sh
npx shadcn@latest add @tidal-pro/progress
```

Stylesheets: `components/ui/tidal.css`, `components/ui/progress.css`.

## Minimal example

```tsx
import"./components/ui/tidal.css";
import"./components/ui/progress.css";
import{TidalProgress}from"./components/ui/progress";
export default()=><div className="tidal-scope"><TidalProgress label={"Demo"}/></div>;
```

## Structured props

- `TidalProgress.label: string`: Required label value accepted by this exported component.
- `TidalProgress.description?: string | undefined`: Optional description value accepted by this exported component.
- `TidalProgress.max?: number | undefined` (default 100): Optional max value accepted by this exported component.
- `TidalProgress.showValue?: boolean | undefined` (default true): Optional show value value accepted by this exported component.
- `TidalProgress.status?: "error" | "active" | "paused" | undefined` (default "active"): Optional status value accepted by this exported component.
- `TidalProgress.value?: number | null | undefined`: Omit, pass null, or pass a nonfinite number when the amount of work is unknown.
- `TidalProgress.valueLabel?: string | undefined`: A contextual reading such as "3 of 8 files". Also becomes the accessible value text.
- `TidalProgress.variant?: "bar" | "ring" | undefined` (default "bar"): Optional variant value accepted by this exported component.

## Complete usage example

[Source](https://tidalui.com/examples/progress.tsx) | [Manifest](https://tidalui.com/examples/progress.json). Install the listed additional dependencies. Consumer fixture: TypeScript pass; Vite pass. This fixture check is distinct from the actual shadcn install receipt.

```tsx
import "./components/ui/tidal.css";

import { useEffect, useLayoutEffect, useRef, useState } from "react";

import { CloudUpload, FileCode2, Palette, Image, Pause, Play, RotateCcw } from "lucide-react";

import { TidalProgress } from "./components/ui/progress";

import { TidalButton } from "./components/ui/tidal-button";

import "./components/ui/progress.css";



const tidalExampleStyles = ".progress-specimen {\n  width: 100%;\n  max-width: 620px;\n  padding: 28px;\n  border: 1px solid var(--t-border);\n  border-radius: var(--t-radius-card);\n  background: var(--t-surface);\n  box-shadow:\n    0 24px 40px -28px #00000035,\n    0 2px 4px #00000008;\n}\n.progress-specimen > h3 {\n  font-size: 29px;\n  line-height: 1.08;\n  letter-spacing: -1px;\n  font-weight: 500;\n  margin: 13px 0 26px;\n}\n.progress-specimen > h3 > em {\n  font-family: \"Instrument Serif\", serif;\n  font-size: 1.2em;\n  font-weight: 400;\n}\n.progress-demo-package {\n  position: relative;\n  padding: 18px 20px 21px;\n  border: 1px solid var(--t-border);\n  border-radius: 12px;\n  background: linear-gradient(135deg, var(--t-subtle), var(--t-surface));\n  overflow: hidden;\n}\n.progress-demo-package-top {\n  display: flex;\n  justify-content: space-between;\n  align-items: center;\n  gap: 12px;\n  font-size: 11px;\n  letter-spacing: 0.8px;\n  color: var(--t-muted);\n  margin-bottom: 17px;\n}\n.progress-demo-package-top > span:first-child {\n  display: flex;\n  align-items: center;\n  gap: 8px;\n}\n.progress-demo-package-top > span:last-child {\n  font-size: 11px;\n}\n.progress-demo-package .tidal-progress[data-variant=\"ring\"] {\n  padding-right: 80px;\n}\n.progress-demo-package .tidal-progress-heading {\n  font-size: 13px;\n}\n.progress-demo-package .tidal-progress-description {\n  font-size: 11px;\n}\n.progress-demo-file-stack {\n  position: absolute;\n  right: 27px;\n  bottom: 39px;\n  width: 64px;\n  height: 74px;\n  pointer-events: none;\n}\n.progress-demo-file-stack > span {\n  position: absolute;\n  inset: 0;\n  border: 1px solid var(--t-border);\n  border-radius: 8px;\n  background: var(--t-surface);\n  box-shadow: 0 3px 6px #00000012;\n  display: grid;\n  place-items: center;\n  transition:\n    transform 420ms var(--t-ease-spring),\n    background 240ms,\n    color 240ms;\n}\n.progress-demo-file-stack > span:nth-child(1) {\n  transform: translate(-8px, -5px);\n}\n.progress-demo-file-stack > span:nth-child(2) {\n  transform: translate(0, -3px);\n}\n.progress-demo-file-stack > span:nth-child(3) {\n  transform: translate(8px, 0);\n}\n.progress-specimen[data-phase=\"running\"]\n  .progress-demo-file-stack\n  > span:nth-child(1) {\n  transform: translate(-13px, -9px);\n}\n.progress-specimen[data-phase=\"running\"]\n  .progress-demo-file-stack\n  > span:nth-child(3) {\n  transform: translate(13px, 3px);\n}\n.progress-specimen[data-phase=\"complete\"]\n  .progress-demo-file-stack\n  > span:last-child {\n  background: var(--t-ink);\n  color: var(--t-surface);\n  border-color: var(--t-ink);\n  transform: translate(8px, -5px);\n}\n.progress-demo-files {\n  margin-top: 21px;\n}\n.progress-demo-file {\n  display: flex;\n  gap: 13px;\n  align-items: flex-start;\n  border-bottom: 1px solid var(--t-border);\n  padding: 14px 0;\n}\n.progress-demo-file > span {\n  display: grid;\n  place-items: center;\n  flex: none;\n  width: 34px;\n  height: 39px;\n  background: var(--t-subtle);\n  border: 1px solid var(--t-border);\n  border-radius: 7px;\n}\n.progress-demo-file > .tidal-progress {\n  flex: 1;\n  min-width: 0;\n}\n.progress-demo-file .tidal-progress-heading {\n  font-size: 11px;\n}\n.progress-demo-file .tidal-progress-reading {\n  font-size: 11px;\n}\n.progress-demo-file .tidal-progress-meter {\n  margin-top: 9px;\n}\n.progress-demo-file .tidal-progress-track {\n  height: 4px;\n}\n.progress-demo-file .tidal-progress-footer {\n  margin-top: 7px;\n  font-size: 11px;\n}\n.progress-demo-file .tidal-progress-icon {\n  width: 11px;\n  height: 11px;\n}\n.progress-demo-actions {\n  display: flex;\n  align-items: center;\n  flex-wrap: wrap;\n  gap: 7px;\n  margin-top: 22px;\n}\n.progress-demo-actions > .tidal-button {\n  font-size: 11px;\n  padding-inline: 12px;\n}\n.progress-demo-actions > .tidal-button:last-child {\n  min-width: 44px;\n  padding-inline: 12px;\n}\n.progress-demo-message {\n  font-size: 11px;\n  line-height: 1.8;\n  color: var(--t-ink);\n  margin: 17px 0 0;\n  min-height: 36px;\n}\n.progress-demo-note {\n  font-size: 11px;\n  color: var(--t-muted);\n  line-height: 1.6;\n  margin: 9px 0 0;\n}\n@media (max-width: 480px) {\n  .progress-specimen {\n    padding: 22px;\n  }\n  .progress-demo-package {\n    padding: 16px;\n  }\n  .progress-demo-package .tidal-progress[data-variant=\"ring\"] {\n    padding-right: 0;\n    grid-template-columns: 76px minmax(0, 1fr);\n    column-gap: 13px;\n  }\n  .progress-demo-package\n    .tidal-progress[data-variant=\"ring\"]\n    .tidal-progress-meter {\n    width: 76px;\n    height: 76px;\n  }\n  .progress-demo-package .tidal-progress-heading {\n    font-size: 11px;\n  }\n  .progress-demo-file-stack {\n    display: none;\n  }\n  .progress-demo-package-top {\n    font-size: 11px;\n    gap: 8px;\n  }\n  .progress-demo-package-top > span:last-child {\n    font-size: 11px;\n  }\n  .progress-demo-file {\n    gap: 10px;\n  }\n  .progress-demo-actions > .tidal-button {\n    font-size: 11px;\n    padding-inline: 9px;\n  }\n  .progress-demo-actions > .tidal-button:last-child {\n    padding-inline: 8px;\n  }\n}\n@media (prefers-reduced-motion: reduce) {\n  .progress-demo-file-stack > span {\n    rotate: none;\n    transform: none !important;\n  }\n}";

const files = [
  { name: "Interface.tsx", size: 1200, Icon: FileCode2 },
  { name: "Theme.css", size: 800, Icon: Palette },
  { name: "Preview.svg", size: 2800, Icon: Image },
];

type Phase = "idle" | "preparing" | "running" | "paused" | "error" | "complete";

export function ProgressDemo() {
  const [phase, setPhase] = useState<Phase>("idle");
  const [value, setValue] = useState(0);
  const [fail, setFail] = useState(false);
  const messageRef = useRef<HTMLParagraphElement>(null);
  const focusOwner = useRef<HTMLElement | null>(null);
  useEffect(() => {
    if (phase === "preparing") {
      const timer = setTimeout(() => setPhase("running"), 700);
      return () => clearTimeout(timer);
    }
    if (phase !== "running") return;
    const timer = setTimeout(() => {
      const next = Math.min(value + 400, 4800);
      setValue(next);
      if (fail && next >= 2800) setPhase("error");
      else if (next === 4800) setPhase("complete");
    }, 240);
    return () => clearTimeout(timer);
  }, [phase, value, fail]);
  useLayoutEffect(() => {
    if ((phase !== "complete" && phase !== "error") || !focusOwner.current)
      return;
    const active = document.activeElement;
    if (active === document.body || active === focusOwner.current)
      messageRef.current?.focus({ preventScroll: true });
    focusOwner.current = null;
  }, [phase]);
  function start(withFailure: boolean, source: HTMLElement) {
    focusOwner.current = source;
    setValue(0);
    setFail(withFailure);
    setPhase("preparing");
  }
  const status =
    phase === "paused" ? "paused" : phase === "error" ? "error" : "active";
  const locked =
    phase === "preparing" || phase === "running" || phase === "paused";
  const message =
    phase === "preparing"
      ? "Checking the sample package. Its duration is unknown."
      : phase === "running"
        ? "The sample is advancing in measured 400 KB chunks."
        : phase === "paused"
          ? "Paused at the current amount. Resume to continue."
          : phase === "error"
            ? "A simulated interruption. Retry keeps the completed work."
            : phase === "complete"
              ? "All 4.8 MB of the fictional package is ready. Nothing was uploaded."
              : "A fictional package. All actions stay inside this browser.";
  return (
    <div className="progress-specimen" data-phase={phase}>
      <div className="progress-demo-package">
        <div className="progress-demo-package-top">
          <span>
            <CloudUpload size={16} aria-hidden="true" /> NORTHSTAR PACKAGE
          </span>
          <span>3 SAMPLE FILES</span>
        </div>
        <TidalProgress
          label="Sample package preparation"
          variant="ring"
          value={phase === "preparing" ? null : value}
          max={4800}
          status={status}
          description={
            phase === "preparing"
              ? "Checking the sample files"
              : `${(value / 1000).toFixed(1)} of 4.8 MB`
          }
        />
        <div className="progress-demo-file-stack" aria-hidden="true">
          {files.map(({ Icon, name }, i) => (
            <span key={name} style={{ rotate: `${(i - 1) * 5}deg` }}>
              <Icon size={18} />
            </span>
          ))}
        </div>
      </div>
      <div className="progress-demo-files">
        {files.map(({ name, size, Icon }, i) => {
          const prior = files
            .slice(0, i)
            .reduce((sum, file) => sum + file.size, 0);
          const amount = Math.min(Math.max(value - prior, 0), size);
          return (
            <div className="progress-demo-file" key={name}>
              <span>
                <Icon size={17} aria-hidden="true" />
              </span>
              <TidalProgress
                label={name}
                value={amount}
                max={size}
                status={amount === size ? "active" : status}
                description={`${size / 1000} MB sample file`}
              />
            </div>
          );
        })}
      </div>
      <div className="progress-demo-actions">
        <TidalButton
          onClick={(event) => start(false, event.currentTarget)}
          disabled={locked || phase === "complete"}
        >
          {phase === "complete" ? "Sample complete" : "Start sample"}
        </TidalButton>
        <TidalButton
          variant="secondary"
          disabled={
            phase === "idle" || phase === "preparing" || phase === "complete"
          }
          onClick={() => {
            if (phase === "running") setPhase("paused");
            else {
              if (phase === "error") setFail(false);
              setPhase("running");
            }
          }}
        >
          {phase === "paused" || phase === "error" ? (
            <Play size={12} aria-hidden="true" />
          ) : (
            <Pause size={12} aria-hidden="true" />
          )}
          {phase === "paused"
            ? "Resume"
            : phase === "error"
              ? "Retry remaining"
              : "Pause"}
        </TidalButton>
        <TidalButton
          variant="secondary"
          onClick={(event) => start(true, event.currentTarget)}
          disabled={locked}
        >
          Try failure
        </TidalButton>
        <TidalButton
          variant="ghost"
          aria-label="Reset sample transfer"
          onClick={() => {
            focusOwner.current = null;
            setPhase("idle");
            setValue(0);
            setFail(false);
          }}
          disabled={phase === "idle"}
        >
          <RotateCcw size={14} aria-hidden="true" />
        </TidalButton>
      </div>
      <p
        ref={messageRef}
        className="progress-demo-message"
        role="status"
        tabIndex={-1}
      >
        {message}
      </p>
      <p className="progress-demo-note">
        Real progress comes from your operation. This is a local simulation.
      </p>
    </div>
  );
}

export default function AgentExample() {
  return (
    <div className="tidal-scope" data-theme="light" dir="ltr">
      <style>{tidalExampleStyles}</style>
      <ProgressDemo />
    </div>
  );
}

```

## Gotchas

- Install the declared registry dependencies and render inside a tidal-scope with the foundation stylesheet loaded.

## Theme and accessibility

{"tokens":["--t-accent","--t-border","--t-border-strong","--t-canvas","--t-danger","--t-display","--t-ease-out","--t-ease-spring","--t-faint","--t-font","--t-ink","--t-line","--t-muted","--t-primary","--t-primary-contrast","--t-radius-card","--t-radius-control","--t-radius-overlay","--t-radius-panel","--t-ring","--t-shadow-lg","--t-shadow-soft","--t-soft","--t-subtle","--t-surface","--t-wash"],"darkMode":true}

{"keyboard":["Arrow-key behavior follows the exported composite-control implementation."],"aria":"The component wires labels and relationships from consumer-provided visible text or ARIA props; preserve those labels in production.","notes":"Verify focus visibility, text alternatives, contrast, and reduced motion in the final composition."}

Required label. Optional value:number|null (omitted/nonfinite means unknown), max(default100; invalid/nonpositive falls back100), status active|paused|error(defaultactive), variant bar|ring(defaultbar), description, valueLabel (custom visual and accessible reading; ring context sits beside the numeric ring), showValue(defaulttrue), native wrapper div attributes/ref/className/style. Finite values clamp0..max. Active atmax becomes complete; paused/error retain the supplied amount. Integer percentages round down so incomplete work never claims100. Progressbar exposes immediate exact value/max and contextual value text; it is read-only and does not announce each tick. Consumers own actual work, errors, persistence and any completion announcement. Unknown active indicators animate; paused/error and reduced motion stop loops. Ring/rail geometry and persistent digit columns transition from their current rendered positions.
