<XrProgress>
Progress: a bar that fills up to value / max, a bar that sweeps when the amount is unknown, or a spinner. It animates on the XR frame loop, so it keeps moving inside the headset.
Usage
vue
<template>
<!-- Determinate: 0..max, clamped -->
<XrProgress :value="downloaded" :max="total" label="Downloading" show-value />
<!-- Unknown length -->
<XrProgress indeterminate label="Connecting" />
<XrProgress variant="spinner" label="Loading rooms…" />
<XrProgress variant="spinner" :size="24" />
</template>valueandmax(100 by default): the bar fillsvalue / maxof the track. Values outside0..maxare clamped.labelgoes above a bar and next to a spinner;show-valueadds the percentage at the end of the label row.indeterminatesweeps a segment across the track instead of filling it; a spinner is always indeterminate.size: a spinner's diameter, or a bar's thickness, in dmm (32 and 8 by default).
A bar stretches to the width of its container; a spinner is as wide as it is tall, plus its label.
Nothing re-renders per frame while a bar is determinate: only the indeterminate bar and the spinner animate (the spinner in eight steps a second turn).
API
Props
| Prop | Type | Default | Description |
|---|---|---|---|
value | number | 0 | How much is done, from 0 to max. Clamped. |
ui | Record<string, unknown> | {} | Escape hatch: raw uikit (@pmndrs/uikit) properties for the outer container, merged last. |
variant | "bar" | "spinner" | 'bar' | A bar that fills, or a spinning ring of dots. |
parts | Partial<Record<"fill" | "label" | "track" | "value" | "dot" | "ring", Record<string, unknown>>> | Raw uikit properties per inner part, merged after the defaults: label, value (the percentage), track, fill (bar); ring, dot (spinner). | |
max | number | 100 | The value at which it is complete. |
indeterminate | boolean | The amount is unknown: the bar sweeps instead of filling. A spinner always is. | |
showValue | boolean | Show the percentage at the end of the label row (bar only, not when indeterminate). | |
label | string | Text above the bar (next to a spinner). | |
size | number | Spinner diameter, or bar thickness, in dmm. Defaults to 32 (spinner) and 8 (bar). |