A simple progress bar to indicate completion or loading status.
import { Progress } from '@fluxui-dev/react';<Progress value={75} />
Set a custom maximum value with the max prop for non-percentage scales.
<Progress value={3} max={7} />
Override the default accent color with the color prop.
<Progress value={75} color="purple" />
Customize the height of the progress bar using the className prop.
<Progress value={75} className="h-3" />
Wrap the progress bar in a Field to add a label and description, and name the bar for screen readers with aria-label.
import { Field, Progress } from '@fluxui-dev/react';<Field> <Field.Label>Upload progress</Field.Label> <Progress value={42} color="blue" aria-label="Upload progress" /> <Field.Description>Uploading 3 of 7 files...</Field.Description></Field>
Display the current value in the label or inline next to the bar.
<Field> <Field.Label trailing={<span className="tabular-nums">75%</span>}> Storage </Field.Label> <Progress value={75} aria-label="Storage" /></Field><Field> <Field.Label>Storage</Field.Label> <div className="flex items-center gap-4 -mt-2"> <Progress value={75} aria-label="Storage" /> <span className="text-sm tabular-nums ...">75%</span> </div></Field>
Pass a value from state to update the bar as the work progresses.
import { useState } from 'react';import { Button } from '@fluxui-dev/react';const [progress, setProgress] = useState(50);<Button size="sm" onClick={() => setProgress(progress - 10)}>Less</Button><Button size="sm" onClick={() => setProgress(progress + 10)}>More</Button><Progress value={progress} />
|
Prop
|
Description
|
|---|---|
| value |
Current progress value (min to max). Default: 0.
|
| max |
Maximum value. Default: 100.
|
| min |
Minimum value. Default: 0.
|
| color |
Bar fill color (e.g., blue, red, green, zinc). Default: accent color.
|
| getAriaValueText |
Function returning the text screen readers announce for the current value. Defaults to the percentage, such as 75%.
|
| className |
CSS classes applied to the track, such as h-3 for a taller bar.
|
|
CSS Variable
|
Description
|
|---|---|
| --flux-progress |
The computed progress as a raw number (0–100).
|
| --flux-progress-percentage |
The computed progress as a percentage string (e.g., 75%). Used internally to set the bar width.
|
|
Attribute
|
Description
|
|---|---|
| data-flux-progress |
Applied to the root element for styling and identification.
|
| data-complete |
Applied to the root element once the value reaches max.
|