# Progress

A determinate or indeterminate progress indicator.

A determinate or indeterminate progress indicator.

```tsx
import { Progress, Stack } from "@zentara-co/zenos-ui";

type CatalogVariantProps = { limit?: number };

const limited = <T,>(items: readonly T[], limit?: number) =>
  limit === undefined ? items : items.slice(0, limit);

function ProgressVariantsExample({ limit }: CatalogVariantProps = {}) {
  return (
    <Stack gap="4" className="w-full">
      {limited(["primary", "success", "information", "danger"] as const, limit).map((variant) => (
        <Stack key={variant} gap="2">
          <span className="text-sm font-medium">{variant}</span>
          <Progress value={64} variant={variant} aria-label={`${variant} progress`} />
        </Stack>
      ))}
      {limit === undefined &&
        (["sm", "md", "lg"] as const).map((size) => (
          <Progress key={size} value={42} size={size} aria-label={`${size} progress`} />
        ))}
    </Stack>
  );
}

function ProgressPreviewExample() {
  return <ProgressVariantsExample limit={3} />;
}
```

## Import

```tsx
import { Progress } from "@zentara-co/zenos-ui";
```

## Variants

Choose a semantic tone that matches the operation’s status. `primary` is neutral progress, `success` indicates a positive completion path, `information` supports informational work, and `danger` signals a failing or risky operation.

```tsx
import { Progress, Stack } from "@zentara-co/zenos-ui";

type CatalogVariantProps = { limit?: number };

const limited = <T,>(items: readonly T[], limit?: number) =>
  limit === undefined ? items : items.slice(0, limit);

function ProgressVariantsExample({ limit }: CatalogVariantProps = {}) {
  return (
    <Stack gap="4" className="w-full">
      {limited(["primary", "success", "information", "danger"] as const, limit).map((variant) => (
        <Stack key={variant} gap="2">
          <span className="text-sm font-medium">{variant}</span>
          <Progress value={64} variant={variant} aria-label={`${variant} progress`} />
        </Stack>
      ))}
      {limit === undefined &&
        (["sm", "md", "lg"] as const).map((size) => (
          <Progress key={size} value={42} size={size} aria-label={`${size} progress`} />
        ))}
    </Stack>
  );
}

function ProgressSemanticVariantsExample() {
  return <ProgressVariantsExample limit={4} />;
}
```

## Sizes

Size changes track thickness without changing the measured value.

```tsx
import { Progress, Stack, Text } from "@zentara-co/zenos-ui";

function ProgressSizesExample() {
  return (
    <Stack gap="5" className="w-full max-w-xl">
      {(["sm", "md", "lg"] as const).map((size) => (
        <Stack key={size} gap="2">
          <Text size="s" weight="medium">
            {size}
          </Text>
          <Progress value={58} size={size} aria-label={`${size} progress`} />
        </Stack>
      ))}
    </Stack>
  );
}
```

## Determinate and indeterminate

Pass a numeric value when the application knows completion. Omit `value`, or pass `null`, when duration cannot be estimated.

```tsx
import { Progress, Stack, Text } from "@zentara-co/zenos-ui";

function ProgressStatesExample() {
  return (
    <Stack gap="5" className="w-full max-w-xl">
      <Stack gap="2">
        <Text size="s" weight="medium">
          Determinate
        </Text>
        <Progress value={68} aria-label="Upload progress" />
      </Stack>
      <Stack gap="2">
        <Text size="s" weight="medium">
          Indeterminate
        </Text>
        <Progress aria-label="Preparing report" />
      </Stack>
    </Stack>
  );
}
```

## Compound composition

Compose the parts when a visible label and formatted value belong beside the track. Connect the label to the progressbar with `aria-labelledby`.

```tsx
import { Progress, Stack } from "@zentara-co/zenos-ui";

function ProgressCompoundExample() {
  return (
    <Progress.Root
      value={18}
      max={24}
      variant="success"
      size="lg"
      aria-labelledby="scan-progress-label"
    >
      <Stack direction="row" align="center" justify="between" gap="4" className="mb-2">
        <Progress.Label id="scan-progress-label">Assets scanned</Progress.Label>
        <Progress.Value format={(value, maximum) => `${value} of ${maximum}`} />
      </Stack>
      <Progress.Track>
        <Progress.Indicator />
      </Progress.Track>
    </Progress.Root>
  );
}
```

## Custom styling

Use `className` on `Progress.Root` for layout and width. Override the track and indicator with semantic tokens on `Progress.Track` and `Progress.Indicator`; custom classes merge after the built-in variant fill, so accent backgrounds replace `variant` colors when both are set. Style `Progress.Label` and `Progress.Value` for tinted headers without changing bar behavior.

For a one-line bar, `` still accepts root `className`. For full control, compose `Progress.Root`, `Progress.Track`, and `Progress.Indicator` explicitly.

```tsx
import { Progress, Stack } from "@zentara-co/zenos-ui";

function ProgressCustomExample() {
  return (
    <Progress.Root
      value={72}
      size="lg"
      aria-label="Campaign reach"
      className="w-full max-w-md rounded-lg border border-border-accent-purple-default bg-background-accent-purple-subtlest-default p-4"
    >
      <Stack direction="row" align="center" justify="between" gap="4" className="mb-3">
        <Progress.Label className="text-text-accent-purple-bolder">Campaign reach</Progress.Label>
        <Progress.Value className="font-medium text-text-accent-purple-bolder" />
      </Stack>
      <Progress.Track className="bg-background-accent-purple-subtler-default">
        <Progress.Indicator className="bg-background-accent-purple-bolder-default" />
      </Progress.Track>
    </Progress.Root>
  );
}
```

## Variants

primary, success, information, danger

## Sizes

sm, md, lg

## Anatomy

```text
Progress.Root
Progress.Track
Progress.Indicator
Progress.Label
Progress.Value
```

## API

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| value | number \| null | null | Current value; null is indeterminate. |
| max | number | 100 | Maximum value. |
| variant | ProgressVariant | primary | Indicator color. |
| size | sm \| md \| lg | md | Track thickness. |
| format | (value: number, maximum: number) => ReactNode | — | Formats the visible Progress.Value content. |
| Indicator.value | number | — | Overrides the root value for a custom indicator. |
| Root.className | string | — | Layout and width on the progressbar root. |
| Track.className | string | — | Merged after default track styles; override fill and height context. |
| Indicator.className | string | — | Merged after variant indicator color; use semantic tokens to replace the default fill. |
| Label.className / Value.className | string | — | Typography and color for compound label and value text. |
| native props | React.HTMLAttributes<HTMLDivElement> | — | Forwards native attributes, events, aria-*, data-*, className, style, and ref. |

Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.

## Accessibility

Progress exposes `role="progressbar"` with minimum, maximum, and current value for determinate work. Indeterminate progress omits `aria-valuenow`. Give every progressbar an accessible name with `aria-label` or `aria-labelledby`; the visual `Progress.Label` is not connected automatically. Announce completion separately when the surrounding workflow needs a status update.

Source: https://zenos-ui.pages.dev/components/progress/