WlProgress
Appearance
Full example
<div class="wl-stack" data-space="md">
<WlProgress
:value="65"
show-value
aria-label="Material completion"
/>
</div>Indicators
Full example
<div class="wl-stack" data-space="md">
<WlProgress
:value="65"
show-value
aria-label="Material completion"
/>
</div>Regular, thin and completed progress
Default/ok, thin, showValue, accessible names, changing values and restart.
neutralaccentinfosuccesswarningdangerPrepared: 40%.
Full example
<script setup lang="ts">
import { WlButton, WlProgress, type WlTone } from "legato-ui";
import { ref } from "vue";
const value = ref(40);
const tones = ["neutral", "accent", "info", "success", "warning", "danger"] as const satisfies readonly WlTone[];
</script>
<template>
<div class="wl-stack" data-space="lg">
<div class="wl-stack" data-space="sm">
<div v-for="tone in tones" :key="tone" class="showcase-progress-tone">
<code>{{ tone }}</code>
<WlProgress :aria-label="tone" :value="65" :tone="tone" />
</div>
</div>
<WlProgress :value="64" aria-label="Default progress" />
<WlProgress :value="32" thin aria-label="Thin progress" />
<WlProgress :value="100" tone="success" aria-label="Completed operation" />
<WlProgress
:value="value"
:tone="value === 100 ? 'success' : 'accent'"
show-value
aria-label="Local preparation progress"
/>
<div class="wl-inline" data-space="sm">
<WlButton size="sm" :disabled="value === 100" @click="value = Math.min(100, value + 20)">
{{ "Add 20%" }}
</WlButton>
<WlButton size="sm" variant="ghost" @click="value = 0">{{ "Start again" }}</WlButton>
</div>
<p class="wl-text-small" role="status">
{{ value === 100 ? "Preparation completed." : "Prepared: " + value + '%.' }}
</p>
</div>
</template>
<style scoped>
.showcase-progress-tone {
display: grid;
grid-template-columns: 8ch minmax(0, 1fr);
align-items: center;
gap: var(--wl-space-sm);
}
</style>Props
Types, accepted values and literal defaults come from the public manifest. Inherited settings name their source; “Not set” means no default is declared.
| Prop | Type / values | Default | Purpose |
|---|---|---|---|
value | number | 0 | Percentage 0–100. |
tone | WlTone | "accent" | Semantic progress color. |
thin | boolean | false | Thin bar. |
showValue | boolean | false | Show the percentage. |
pt | WlPt< | Not set | Attributes of internal Legato UI elements. |
max | number | Not set | Positive finite upper bound; invalid values fall back to 100. |
indeterminate | boolean | Not set | Show activity without exposing a known current value. |
ariaLabel | string | Not set | Accessible name when no external label is referenced. |
ariaLabelledby | string | Not set | ID of the element naming this progress indicator. |
Events
No public events.
Slots
No public slots.
Pass-through: pt
Sections WlProgress are listed below. Attributes merge in this order: createWlPt() WlConfig.ptpt instance. Class and style merge; the last supplied value takes priority for other attributes.
| Section | DOM | Purpose |
|---|---|---|
value | div.wl-progress__value | The value section in WlConfig.pt.progress configuration. |
label | span.wl-progress__label | The label section in WlConfig.pt.progress configuration. |
root | div | The root section in WlConfig.pt.progress configuration. |
Sections refer to the component DOM. Dotted names identify a configuration group and its section; composite parts use their own pt groups. Global and local attributes merge, with class and style added together.
Keyboard and accessibility
- Give the root progressbar an aria-label that explains the specific operation.
- Value is clamped to 0–100 and sets aria-valuenow; showValue adds a visible percentage.
- Thin and ok change appearance. Explain completion/errors and the next available operation in application text.
Keyboard and application responsibilities
Provide a meaningful accessible name and connect labels, hints and errors to the focusable element. Check the behavior with your own data and a screen reader.
WAI-ARIA Authoring PracticesIn your application, check keyboard controls, zoom and focus visibility. State labels and required information must be readable in every theme.