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

Signature TypeScript complète extraite du fichier du composable.

typescript

Interfaces consommées

IProgressTypeProps

API

Paramètres

Paramètres d'entrée acceptés par ce composable.

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

API

Valeurs de retour

Propriétés et méthodes exposées par l'objet retourné par le composable.

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

Exemples

Extraits de code prêts à coller.

Linear progress bar

vue

Circular progress with label

vue

Indeterminate loading state

vue