Progress bar API
Import
Section titled “Import”import { ProgressBar } from '@cimpress-ui/react';Accessibility notes
Section titled “Accessibility notes”ProgressBar requires a textual label to remain accessible to assistive technologies. See our accessibility guide for more details.
Non-percentage values
Section titled “Non-percentage values”By default, progress bar operates on percentages, and it expects its value prop to be between 0 and 100. If your data has a different range of allowed values, you don’t need to recalculate it manually - provide the upper limit to the maxValue prop instead, and the progress bar will handle the calculation for you. Note that the progress bar will still display the value as a percentage, unless you override it through the valueLabel prop.
import { ProgressBar } from '@cimpress-ui/react';
export default function Demo() { return <ProgressBar label="Shipments delivered" value={4} maxValue={20} valueLabel="4 of 20" />;}API reference
Section titled “API reference”ProgressBar
Section titled “ProgressBar”Visualizes the progress of an operation.
- Ref<HTMLDivElement>
-
The
reftype for this component.
ProgressBarProps
- 'success' | 'base' | 'warning' | 'critical'
- Defaults to 'base' .
The tone of the progress bar.
- boolean
showValue
Section titled “ showValue ” - Defaults to true .
Whether the value of the progress bar should be displayed above it.
- string
description
Section titled “ description ” -
A description for the progress bar.
- string
-
The element's unique identifier. See MDN.
- boolean
data-cim-style-root
Section titled “ data-cim-style-root ” -
Use this attribute to "claim" the component tree for exclusive Cimpress UI usage.
- string
UNSAFE_className
Section titled “ UNSAFE_className ” -
Sets the CSS className for the element. Only use as a last resort. Use style props instead.
See styling guide.
- CSSProperties
UNSAFE_style
Section titled “ UNSAFE_style ” -
Sets the CSS style for the element. Only use as a last resort. Use style props instead.
See styling guide.
- string
label
Section titled “ label ” -
The content to display as the label.
- string
aria-label
Section titled “ aria-label ” -
Defines a string value that labels the current element.
- string
aria-labelledby
Section titled “ aria-labelledby ” -
Identifies the element (or elements) that labels the current element.
- string
aria-describedby
Section titled “ aria-describedby ” -
Identifies the element (or elements) that describes the object.
- string
aria-details
Section titled “ aria-details ” -
Identifies the element (or elements) that provide a detailed, extended description for the object.
- number
value
Section titled “ value ” - Defaults to 0 .
The current value (controlled).
- number
maxValue
Section titled “ maxValue ” - Defaults to 100 .
The largest value allowed for the input.
- ReactNode
valueLabel
Section titled “ valueLabel ” -
The content to display as the value's label (e.g. 1 of 4).
StyleProps
- Responsive<Spacing | "auto">
margin
Section titled “ margin ” -
The amount of margin applied to all edges of this component.
- Responsive<Spacing | "auto">
marginX
Section titled “ marginX ” -
The amount of margin applied to the left and right edges of this component. Takes priority over
margin. - Responsive<Spacing | "auto">
marginY
Section titled “ marginY ” -
The amount of margin applied to the top and bottom edges of this component. Takes priority over
margin. - Responsive<Spacing | "auto">
marginTop
Section titled “ marginTop ” -
The amount of margin applied to the top edge of this component. Takes priority over
marginYandmargin. - Responsive<Spacing | "auto">
marginRight
Section titled “ marginRight ” -
The amount of margin applied to the right edge of this component. Takes priority over
marginXandmargin. - Responsive<Spacing | "auto">
marginBottom
Section titled “ marginBottom ” -
The amount of margin applied to the bottom edge of this component. Takes priority over
marginYandmargin. - Responsive<Spacing | "auto">
marginLeft
Section titled “ marginLeft ” -
The amount of margin applied to the left edge of this component. Takes priority over
marginXandmargin.