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
valueandmax.valueis clamped between 0 andmax. - Indeterminate without
value, andaria-valuenowis left off. labelis the accessible name, so always give one.- The indeterminate slide stops under
prefers-reduced-motion: reduce.
Determinate
Section titled “Determinate”Pass value, and max when the range is not 0 to 100.
value: 40
Code
<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>Indeterminate
Section titled “Indeterminate”Leave value out when the length of the task is unknown.
Code
<script lang="ts"> import { Progress } from "@viamrobotics/prime-ui";</script>
<div class="not-content"> <Progress label="Connecting" /></div>States
Section titled “States”0
50
100
Indeterminate
info
success
warning
danger
Styling
Section titled “Styling”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.
Keyboard
Section titled “Keyboard”The bar is not interactive, so it takes no keys.
Takes extraClasses, ...restProps }: Props as its props.