Feedback
Layout
Progress
A bar or ring for a task’s progress, known or unknown, or for stacked shares of a whole with a legend. Use it for uploads, long tasks or a storage breakdown.
Install
import { Progress } from 'vael-ui'Playground
One value
primary
md
Placement, behaviour and animation
line
Usage
<script setup lang="ts">
import { Progress } from 'vael-ui'
</script>
<template>
<Progress :value="60" aria-label="Upload progress" />
</template>Motion New
Progress: its appearance, states, and the fill's timing and when: 'visible'.
<Progress
:motion="{ states: { complete: { root: { scale: 1.04 } } } }"
/>| Name | Type | Description |
|---|---|---|
initialexit | roottrackfilllegend | Sets where each part comes in from and leaves to: any CSS property, plus x, y and blur. A plain number is px, or degrees for rotate. |
states | completeindeterminate | Sets values per part that hold while a state is on. An array is a set of keyframes that plays once as the state turns on, such as a shake on invalid. |
enterleave | (parts, context) => animation | Animates the parts with GSAP, motion or element.animate(). Return the animation and the component waits for it, and stops it if interrupted. |
spring | { damping, response } | Times how its value moves when it changes, from the steppers, the keyboard or your code. |
springdurationeasing | { damping, response } | number | string | Times all of it: a spring, or a duration in ms with an easing. Never both. |
false | boolean | Turns its motion off, for an animation of your own on its exposed elements. |
Accessibility
It has no keyboard interaction of its own.
- Renders
role="progressbar"witharia-valuemin="0",aria-valuemaxandaria-valuenow. With novalue, it is indeterminate and leaves outaria-valuenow. - Name it with the
labelprop,aria-labeloraria-labelledby. They land on the bar, not the wrapper, and so doesaria-describedby. - With segments,
aria-valuenowis their total.valueTextsetsaria-valuetext, such as “42 GB of 100 GB”. - Under reduced motion, the fill stops transitioning and the indeterminate state pulses instead of sliding.