Skip to content

Progress

A horizontal progress bar. Determinate when value is set, indeterminate otherwise, when the fill slides along the track unless the viewer prefers reduced motion. It is a progressbar with the aria value attributes, named by label.

<Progress value={uploaded} max={total} label="Upload" />
<Progress label="Connecting" />
<Progress
  value={40}
  label="Upload"
/>
  • Determinate with value and max. value is clamped between 0 and max.
  • Indeterminate without value, and aria-valuenow is left off.
  • label is the accessible name, so always give one.
  • The indeterminate slide stops under prefers-reduced-motion: reduce.

Pass value, and max when the range is not 0 to 100.

value: 40

Code
Determinate.svelte
<script lang="ts">
import { Progress } from "@viamrobotics/prime-ui";
let value = $state(40);
</script>
<div class="not-content flex flex-col gap-3">
<Progress {value} label="Upload" />
<input type="range" min="0" max="100" aria-label="Value" bind:value />
<p class="text-sm text-subtle-2">value: <code>{value}</code></p>
</div>

Leave value out when the length of the task is unknown.

Code
Indeterminate.svelte
<script lang="ts">
import { Progress } from "@viamrobotics/prime-ui";
</script>
<div class="not-content">
<Progress label="Connecting" />
</div>

0

50

100

Indeterminate

info

success

warning

danger

class lands on the track, which wears the progress component class. The fill is the .progress-fill child. The tone classes progress-info, progress-success, progress-warning, and progress-danger set the fill color, and a bar with none is info. See Component classes for the plain HTML form.

The bar is not interactive, so it takes no keys.

Takes extraClasses, ...restProps }: Props as its props.