2026-06-17 11:19:31 +08:00
# Progress
2026-06-22 18:19:38 +08:00
<Preview>
<div class="progress max-w-sm" role="progressbar" aria-label="Loading" aria-valuenow="66" aria-valuemin="0" aria-valuemax="100">
2026-06-20 13:58:42 +08:00
<span style="width: 66%"></span>
2026-06-17 11:19:31 +08:00
</div>
</Preview>
## Usage
2026-06-20 13:58:42 +08:00
Add `class="progress"` and `role="progressbar"` to the root. Use one child `<span>` as the visual indicator.
2026-06-17 11:19:31 +08:00
```html
2026-06-20 13:58:42 +08:00
<div class="progress" role="progressbar" aria-label="Loading" aria-valuenow="66" aria-valuemin="0" aria-valuemax="100">
<span style="width: 66%"></span>
2026-06-17 11:19:31 +08:00
</div>
```
2026-06-20 13:58:42 +08:00
### HTML structure
<dl>
<dt><code><div class="progress" role="progressbar"></code></dt>
<dd>Progress root. Set <code>aria-label</code> or <code>aria-labelledby</code>, plus <code>aria-valuenow</code>, <code>aria-valuemin</code>, and <code>aria-valuemax</code>.</dd>
<dt><code><span style="width: ..."></code></dt>
<dd>Visual indicator. Its width should match the current value.</dd>
</dl>
## Examples
### Label
2026-06-22 18:19:38 +08:00
<Preview>
<div class="field max-w-sm">
<div class="flex items-center gap-3 text-sm">
2026-06-20 13:58:42 +08:00
<label id="progress-label">Upload progress</label>
2026-06-22 18:19:38 +08:00
<output class="ms-auto tabular-nums">66%</output>
2026-06-20 13:58:42 +08:00
</div>
<div class="progress" role="progressbar" aria-labelledby="progress-label" aria-valuenow="66" aria-valuemin="0" aria-valuemax="100">
<span style="width: 66%"></span>
</div>
</div>
</Preview>
### RTL
Progress uses logical direction. Set `dir="rtl"` on the progress root or a parent to fill from the right.
2026-06-22 18:19:38 +08:00
<Preview>
<div dir="rtl" class="progress max-w-sm" role="progressbar" aria-label="تحميل" aria-valuenow="66" aria-valuemin="0" aria-valuemax="100">
2026-06-20 13:58:42 +08:00
<span style="width: 66%"></span>
</div>
</Preview>