ProgressBar
Determinate progress indicator.
Examples
Default
Demo.tsxtsx
import { ProgressBar } from '@var-ui/react';
<ProgressBar label="Uploading assets" value={64} />Props
Accessibility
Built on React Aria Components where applicable.
Determinate progress indicator.
Determinate progress indicator.
import { ProgressBar } from '@var-ui/react';
<ProgressBar label="Uploading assets" value={64} />Built on React Aria Components where applicable.
| Prop | Type | Default | Description |
|---|---|---|---|
className | string | undefined | — | Additional CSS class names merged onto the root element. |
label | string | undefined | — | Label rendered above the track. |
showValueText | boolean | undefined | true | Show the formatted value (e.g. "40%") next to the label. |
| Prop | Type | Default | Description |
|---|---|---|---|
aria-describedby | string | undefined | — | Identifies the element (or elements) that describes the object. |
aria-details | string | undefined | — | Identifies the element (or elements) that provide a detailed, extended description for the object. |
aria-label | string | undefined | — | Defines a string value that labels the current element. |
aria-labelledby | string | undefined | — | Identifies the element (or elements) that labels the current element. |
dir | string | undefined | — | — |
formatOptions | NumberFormatOptions | undefined | { style: 'percent' } | The display format of the value label. |
hidden | boolean | undefined | — | — |
id | string | undefined | — | The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id). |
inert | boolean | undefined | — | — |
isIndeterminate | boolean | undefined | — | Whether presentation is indeterminate when progress isn't known. |
lang | string | undefined | — | — |
maxValue | number | undefined | 100 | The largest value allowed for the input. |
minValue | number | undefined | 0 | The smallest value allowed for the input. |
onAnimationEnd | AnimationEventHandler<HTMLDivElement> | undefined | — | — |
onAnimationEndCapture | AnimationEventHandler<HTMLDivElement> | undefined | — | — |
onAnimationIteration | AnimationEventHandler<HTMLDivElement> | undefined | — | — |
onAnimationIterationCapture | AnimationEventHandler<HTMLDivElement> | undefined | — | — |
onAnimationStart | AnimationEventHandler<HTMLDivElement> | undefined | — | — |
onAnimationStartCapture | AnimationEventHandler<HTMLDivElement> | undefined | — | — |
onAuxClick | MouseEventHandler<HTMLDivElement> | undefined | — | — |
onAuxClickCapture | MouseEventHandler<HTMLDivElement> | undefined | — | — |
onClick | MouseEventHandler<HTMLDivElement> | undefined | — | — |
onClickCapture | MouseEventHandler<HTMLDivElement> | undefined | — | — |
onContextMenu | MouseEventHandler<HTMLDivElement> | undefined | — | — |
onContextMenuCapture | MouseEventHandler<HTMLDivElement> | undefined | — | — |
onDoubleClick | MouseEventHandler<HTMLDivElement> | undefined | — | — |
onDoubleClickCapture | MouseEventHandler<HTMLDivElement> | undefined | — | — |
onGotPointerCapture | PointerEventHandler<HTMLDivElement> | undefined | — | — |
onGotPointerCaptureCapture | PointerEventHandler<HTMLDivElement> | undefined | — | — |
onLostPointerCapture | PointerEventHandler<HTMLDivElement> | undefined | — | — |
onLostPointerCaptureCapture | PointerEventHandler<HTMLDivElement> | undefined | — | — |
onMouseDown | MouseEventHandler<HTMLDivElement> | undefined | — | — |
onMouseDownCapture | MouseEventHandler<HTMLDivElement> | undefined | — | — |
onMouseEnter | MouseEventHandler<HTMLDivElement> | undefined | — | — |
onMouseLeave | MouseEventHandler<HTMLDivElement> | undefined | — | — |
onMouseMove | MouseEventHandler<HTMLDivElement> | undefined | — | — |
onMouseMoveCapture | MouseEventHandler<HTMLDivElement> | undefined | — | — |
onMouseOut | MouseEventHandler<HTMLDivElement> | undefined | — | — |
onMouseOutCapture | MouseEventHandler<HTMLDivElement> | undefined | — | — |
onMouseOver | MouseEventHandler<HTMLDivElement> | undefined | — | — |
onMouseOverCapture | MouseEventHandler<HTMLDivElement> | undefined | — | — |
onMouseUp | MouseEventHandler<HTMLDivElement> | undefined | — | — |
onMouseUpCapture | MouseEventHandler<HTMLDivElement> | undefined | — | — |
onPointerCancel | PointerEventHandler<HTMLDivElement> | undefined | — | — |
onPointerCancelCapture | PointerEventHandler<HTMLDivElement> | undefined | — | — |
onPointerDown | PointerEventHandler<HTMLDivElement> | undefined | — | — |
onPointerDownCapture | PointerEventHandler<HTMLDivElement> | undefined | — | — |
onPointerEnter | PointerEventHandler<HTMLDivElement> | undefined | — | — |
onPointerLeave | PointerEventHandler<HTMLDivElement> | undefined | — | — |
onPointerMove | PointerEventHandler<HTMLDivElement> | undefined | — | — |
onPointerMoveCapture | PointerEventHandler<HTMLDivElement> | undefined | — | — |
onPointerOut | PointerEventHandler<HTMLDivElement> | undefined | — | — |
onPointerOutCapture | PointerEventHandler<HTMLDivElement> | undefined | — | — |
onPointerOver | PointerEventHandler<HTMLDivElement> | undefined | — | — |
onPointerOverCapture | PointerEventHandler<HTMLDivElement> | undefined | — | — |
onPointerUp | PointerEventHandler<HTMLDivElement> | undefined | — | — |
onPointerUpCapture | PointerEventHandler<HTMLDivElement> | undefined | — | — |
onScroll | UIEventHandler<HTMLDivElement> | undefined | — | — |
onScrollCapture | UIEventHandler<HTMLDivElement> | undefined | — | — |
onTouchCancel | TouchEventHandler<HTMLDivElement> | undefined | — | — |
onTouchCancelCapture | TouchEventHandler<HTMLDivElement> | undefined | — | — |
onTouchEnd | TouchEventHandler<HTMLDivElement> | undefined | — | — |
onTouchEndCapture | TouchEventHandler<HTMLDivElement> | undefined | — | — |
onTouchMove | TouchEventHandler<HTMLDivElement> | undefined | — | — |
onTouchMoveCapture | TouchEventHandler<HTMLDivElement> | undefined | — | — |
onTouchStart | TouchEventHandler<HTMLDivElement> | undefined | — | — |
onTouchStartCapture | TouchEventHandler<HTMLDivElement> | undefined | — | — |
onTransitionCancel | TransitionEventHandler<HTMLDivElement> | undefined | — | — |
onTransitionCancelCapture | TransitionEventHandler<HTMLDivElement> | undefined | — | — |
onTransitionEnd | TransitionEventHandler<HTMLDivElement> | undefined | — | — |
onTransitionEndCapture | TransitionEventHandler<HTMLDivElement> | undefined | — | — |
onTransitionRun | TransitionEventHandler<HTMLDivElement> | undefined | — | — |
onTransitionRunCapture | TransitionEventHandler<HTMLDivElement> | undefined | — | — |
onTransitionStart | TransitionEventHandler<HTMLDivElement> | undefined | — | — |
onTransitionStartCapture | TransitionEventHandler<HTMLDivElement> | undefined | — | — |
onWheel | WheelEventHandler<HTMLDivElement> | undefined | — | — |
onWheelCapture | WheelEventHandler<HTMLDivElement> | undefined | — | — |
render | DOMRenderFunction<"div", ProgressBarRenderProps> | undefined | — | Overrides the default DOM element with a custom render function. This allows rendering existing components with built-in styles and behaviors such as router links, animation libraries, and pre-styled components. Requirements: - You must render the expected element type (e.g. if `<button>` is expected, you cannot render an `<a>`). - Only a single root DOM element can be rendered (no fragments). - You must pass through props and ref to the underlying DOM element, merging with your own prop as appropriate. |
slot | string | null | undefined | — | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit `null` value indicates that the local props completely override all props received from a parent. |
style | StyleOrFunction<ProgressBarRenderProps> | undefined | — | The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element. A function may be provided to compute the style based on component state. |
translate | "yes" | "no" | undefined | — | — |
value | number | undefined | 0 | The current value (controlled). |
valueLabel | ReactNode | — | The content to display as the value's label (e.g. 1 of 4). |
Theme this component via createDesignTheme({ components: { progressBar: … } }).
See Customize for the full override API.
Public classes and data attributes from @var-ui/core progressBar().
| Name | Example | Description |
|---|---|---|
class | var-ui-progress-bar | Root / part class name |
data-tone | accent | Recipe variant / state attribute from `@var-ui/core`. |
data-appearance | solid | Recipe variant / state attribute from `@var-ui/core`. |
| Name | Example | Description |
|---|---|---|
class | var-ui-progress-bar__header | Root / part class name |
data-tone | accent | Recipe variant / state attribute from `@var-ui/core`. |
data-appearance | solid | Recipe variant / state attribute from `@var-ui/core`. |
| Name | Example | Description |
|---|---|---|
class | var-ui-progress-bar__label | Root / part class name |
data-tone | accent | Recipe variant / state attribute from `@var-ui/core`. |
data-appearance | solid | Recipe variant / state attribute from `@var-ui/core`. |
| Name | Example | Description |
|---|---|---|
class | var-ui-progress-bar__valueText | Root / part class name |
data-tone | accent | Recipe variant / state attribute from `@var-ui/core`. |
data-appearance | solid | Recipe variant / state attribute from `@var-ui/core`. |
| Name | Example | Description |
|---|---|---|
class | var-ui-progress-bar__track | Root / part class name |
data-tone | accent | Recipe variant / state attribute from `@var-ui/core`. |
data-appearance | solid | Recipe variant / state attribute from `@var-ui/core`. |
| Name | Example | Description |
|---|---|---|
class | var-ui-progress-bar__fill | Root / part class name |
data-tone | accent | Recipe variant / state attribute from `@var-ui/core`. |
data-appearance | solid | Recipe variant / state attribute from `@var-ui/core`. |
Apply via `recipeProps(recipe(…))` or copy the class / data attributes onto your markup.