Skip to content

<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>
  • value and max (100 by default): the bar fills value / max of the track. Values outside 0..max are clamped.
  • label goes above a bar and next to a spinner; show-value adds the percentage at the end of the label row.
  • indeterminate sweeps 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 ​

PropTypeDefaultDescription
valuenumber0How much is done, from 0 to max. Clamped.
uiRecord<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.
partsPartial<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).
maxnumber100The value at which it is complete.
indeterminatebooleanThe amount is unknown: the bar sweeps instead of filling. A spinner always is.
showValuebooleanShow the percentage at the end of the label row (bar only, not when indeterminate).
labelstringText above the bar (next to a spinner).
sizenumberSpinner diameter, or bar thickness, in dmm. Defaults to 32 (spinner) and 8 (bar).

MIT License