Actions and feedback
Progress
A styled native progress element with tones, sizes, stripes and an animated indeterminate state.
Example
<div class="space-y-3">
<progress class="progress" value="64" max="100">64%</progress>
<progress class="progress progress-success progress-sm" value="90" max="100">90%</progress>
<progress class="progress progress-warning progress-lg progress-striped" value="45" max="100">45%</progress>
<progress class="progress progress-danger progress-xs" value="20" max="100">20%</progress>
<progress class="progress progress-info progress-xl" value="72" max="100">72%</progress>
<progress class="progress progress-accent">Loading</progress>
</div>Classes
15 classes. Click a name to copy it. Utilities on the same element always win over component defaults, so any of them can be adjusted with plain utility classes.
| Class | Type | What it does |
|---|---|---|
| Base | Base class of the progress. On a <progress> in the example. Sets block display, width, height, overflow, border and corner radius, and 5 custom properties.CSS |
|
| Size | Extra small size. On a <progress> in the example. Sets --progress-h.CSS |
|
| Size | Small size. On a <progress> in the example. Sets --progress-h.CSS |
|
| Size | Medium, the default size. Not used in the example above. Sets --progress-h.CSS |
|
| Size | Large size. On a <progress> in the example. Sets --progress-h.CSS |
|
| Size | Extra large size. On a <progress> in the example. Sets --progress-h.CSS |
|
| Tone | Primary tone. Not used in the example above. Sets --tone and --tone-fg.CSS |
|
| Tone | Secondary tone. Not used in the example above. Sets --tone and --tone-fg.CSS |
|
| Tone | Accent tone. On a <progress> in the example. Sets --tone and --tone-fg.CSS |
|
| Tone | Neutral tone. Not used in the example above. Sets --tone and --tone-fg.CSS |
|
| Tone | Success tone. On a <progress> in the example. Sets --tone and --tone-fg.CSS |
|
| Tone | Warning tone. On a <progress> in the example. Sets --tone and --tone-fg.CSS |
|
| Tone | Danger tone. On a <progress> in the example. Sets --tone and --tone-fg.CSS |
|
| Tone | Info tone. On a <progress> in the example. Sets --tone and --tone-fg.CSS |
|
| Modifier | Modifier, combined with the progress class. On a <progress> in the example. Sets background.CSS |
Usage
Components ship inside the same stylesheet as the utilities. There is nothing else to install and no script to load: link Monsoon and write the markup.
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/monsooncss">
<!-- Progress: start from the base class, then add modifiers -->
<div class="space-y-3">
<progress class="progress" value="64" max="100">64%</progress>
<progress class="progress progress-success progress-sm" value="90" max="100">90%</progress>
<progress class="progress progress-warning progress-lg progress-striped" value="45" max="100">45%</progress>
<progress class="progress progress-danger progress-xs" value="20" max="100">20%</progress>
<progress class="progress progress-info progress-xl" value="72" max="100">72%</progress>
<progress class="progress progress-accent">Loading</progress>
</div>Theme it with --seed on any ancestor, for example style="--seed: #0d9488", and force a scheme with class="dark" or class="light" on a wrapper.
Accessibility
- Uses the native
progressormeterelement, which exposes its value to assistive technology. Add a visible label oraria-label. - Every interactive part shows a visible focus ring with
:focus-visible, and tone colors pair with-foregroundtokens that keep text at 4.5:1 or better in light and dark mode.