useProgress

Progress
stable

Computes all state needed to render a progress bar or circular progress indicator: a normalised 0-100 value from modelValue and max, thickness as a number, a visibility flag tied to IntersectionObserver, and BEM class/style arrays that handle indeterminate, striped, active, and absolute modes. Used by OrigamProgressLinear and OrigamProgressCircular.

API

Signature

Full TypeScript signature sourced from the composable file.

typescript

Consumed interfaces

IProgressTypeProps

API

Parameters

Input parameters accepted by this composable.

props
required
IProgressTypeProps
Props shared by OrigamProgressLinear and OrigamProgressCircular: modelValue, max, thickness, indeterminate, striped, active, absolute, plus padding and margin props.

API

Return values

Properties and methods exposed by the composable return object.

progress
Two-way bound to modelValue via useVModel. Drive via v-model on the parent component.
normalizedValue
progress / max * 100 — a percentage in [0, 100] ready to set as a CSS custom property or width.
thickness
The thickness prop coerced to a number. Used as strokeWidth for circular or height for linear variants.
max
The max prop parsed as an integer. Defaults to 100.
hasContent
True when the default slot is populated. Used to show/hide the content overlay (e.g. a percentage label inside a circular bar).
progressClasses
Root class array including BEM modifiers for indeterminate, visible (IntersectionObserver), active, striped, absolute, plus padding/margin utility classes.
progressStyles
Root style array for any padding/margin custom values that cannot be expressed as utility classes.

Usage

Examples

Ready-to-paste usage snippets.

Linear progress bar

vue

Circular progress with label

vue

Indeterminate loading state

vue