enes

Progress Bar

A progress bar is a horizontal indicator that communicates the progress of an operation. Set value for determinate progress, or omit it for an indeterminate animation when the duration is unknown.

Usage

<script>
  import { ProgressBar } from 'fluentui-svelte';
</script>

<ProgressBar value={50} />

Value

The value prop sets the current progress value of the bar. It should be a number between 0 and 100.

Indeterminate

If you do not set the value prop, the progress bar enters an indeterminate state, meaning it does not have a specific value. This is useful for operations where the duration is unknown.

Hide Rail

The hideRail prop can be used to hide the progress bar rail.

Status

The status prop allows you to set the status of the progress bar to 'paused' or 'error'. This changes the color of the progress bar to indicate different states.

Component Props

NameTypeDefaultDescription
value bindablenumber | nullThe current value of the progress bar. Leave it unset for an indeterminate bar.
classstringThe class to apply to the progress bar.
ref bindableSVGElementThe DOM reference of the progress bar element.
minnumber0The minimum value of the progress bar.
maxnumber100The maximum value of the progress bar.
hideRailbooleanWhether to hide the rail element.
railElement bindableSVGRectElementThe DOM reference of the rail element.
secondaryTrackElement bindableSVGRectElementThe DOM reference of the secondary track element, used while indeterminate.
trackElement bindableSVGRectElementThe DOM reference of the track element.
status'paused' | 'error'The current status of the progress bar, which recolors the track.
Element Attributes