Shows how much of a task is complete, such as an upload. The indicator slides to the new amount when value changes. The root sets role="progressbar" with aria-valuenow, so give it an aria-label or point aria-labelledby at a visible label.
<script lang="ts">
import { Progress } from "#lib/components/ui/progress/index.js";
</script>
<Progress value={33} aria-label="Upload progress" />pnx remote0 add https://plainsv.com/r/progress.jsonSet max to measure progress in your own units, such as files or bytes. The default is 100, and values outside 0 to max are clamped.
<Progress value={3} max={8} aria-label="Files uploaded" />Omit value or pass null when the amount is unknown. A short indicator sweeps across the track, and it pulses in place instead when the user prefers reduced motion.
<Progress aria-label="Loading" />Set variant to default or destructive. The track uses a light tint of the indicator color.
<Progress variant="destructive" value={33} aria-label="Storage used" />Set size to xs, sm, md, or lg to change the bar thickness. The default is sm, and the corner radius follows the size.
<Progress size="lg" value={33} aria-label="Upload progress" />Set rounded to xs through 4xl or pill to override the radius from the size. Use pill for a pill.
<Progress size="md" rounded="pill" value={33} aria-label="Upload progress" />The Progress props extend the native div attributes. Extra attributes, such as aria-label, pass through to the root. The root also sets data-state to indeterminate, loading, or complete for custom styles.
interface Props extends CompProps<"div"> {
/** Completed amount from `0` to `max`; omit or pass `null` for indeterminate */
value?: number | null;
/** Amount that counts as complete; defaults to `100` */
max?: number;
/** Visual style of the track and indicator */
variant?: "default" | "destructive";
/** Bar thickness on the shared scale; defaults to `sm` */
size?: UiSize;
/** Corner radius; follows `size` when omitted */
rounded?: UiRounded;
}