Skip to content

Progress

A linear or circular progress bar. The value is controlled — drive it from your app as work completes.

Uploading files
html
<div
  data-controller="zag-progress"
  data-part="root"
  data-zag-progress-value-value="65"
  class="space-y-1"
>
  <div class="flex items-center justify-between text-sm">
    <span data-part="label" class="font-medium">Uploading files</span>
    <span data-part="value-text" class="text-muted-foreground"></span>
  </div>
  <div data-part="track" class="bg-muted h-2 overflow-hidden rounded-full">
    <div
      data-part="range"
      class="bg-primary h-full rounded-full transition-all"
      style="width: var(--percent, 0%)"
    ></div>
  </div>
</div>

Parts

root, label, value-text, track, range, circle, circle-track, circle-range. (The last three are for a circular bar.)

Values

AttributeTypeDefaultDescription
data-zag-progress-value-valueNumber0Current value (controlled).
data-zag-progress-min-valueNumber0Minimum value.
data-zag-progress-max-valueNumber100Maximum value.
data-zag-progress-orientation-valueString"horizontal""horizontal" or "vertical".
data-zag-progress-indeterminate-valueBooleanfalseShow the indeterminate state.

Programmatic control

value (getter), percent (getter), set(value) (pass null for indeterminate).