Progress Bar
Alignment target:@astryxdesign/core v0.7.1 · ProgressBar
Usage #
ProgressBar shows the completion ratio of an operation.
<script setup lang="ts">
import { ProgressBar } from '@astryx-vue/core/ProgressBar'
</script>
<template>
<ProgressBar :value="60" label="Upload" show-value />
</template>Anatomy
| Element | Description |
|---|---|
| Progress bar | Container arranging the label row and progress track. |
| Label | Text naming the operation, optionally hidden visually while remaining accessible. |
| Value text | Formatted determinate value shown beside the label when requested. |
| Track | Remaining-progress rail that carries the progressbar semantics. |
| Fill | Painted segment showing completed progress or indeterminate movement. |
| Mark | Labeled target tick positioned on a determinate track. |
Best practices #
| Guidance | Practices |
|---|---|
| Do | Choose a color variant that matches the context: accent for general progress, success for completion, warning or error for alerts. |
| Don't | Place icons or labels inside the bar; compose them alongside it using layout components. |
| Don't | Use multiple progress bars stacked together for the same operation; use one bar with a value label instead. |
Examples #
Progress Bar — Custom format
formatValueLabel turns the current value and max into a label such as disk usage in GB.
Progress Bar — Indeterminate
isIndeterminate is for work whose duration is unknown.
Progress Bar — Semantic variants
Accent, success, warning, error, and neutral, stacked so the status colors can be compared.
Progress Bar — Value label
hasValueLabel shows the current percentage beside the label.
Progress Bar — Marks
Marks use the same scale as the bar. A mark on the fill uses the fill foreground; a mark still on the track uses the text color. Hover or focus reads its name.
Accessibility #
A progress bar has no focusable element, so screen reader users rely on the ARIA attributes the component exposes to learn the current progress. The component therefore puts role="progressbar" on the track and fills in the progress values and name, so assistive technologies can announce it accurately:
- The progress range is described by
aria-valueminandaria-valuemax, which the component sets automatically fromminandmax. - The current progress is described by
aria-valuenow, which is also set automatically. - When
labelis provided, the label is linked to the track througharia-labelledby. - When
descriptionis provided, the description is linked to the track througharia-describedby.
When isIndeterminate is true the progress is unknown, so the component removes aria-valuenow and screen readers announce the bar without a specific value.