Components · Data Display
Progress
Shows how far along a task is.
Component Workbench
Switch between the live interactive preview, syntax-highlighted implementation code, copyable AI coding agent prompt, and designer anatomy blueprint.
Progress · Canonical Spec
Volume Snapshot Compression
68%
Syncing Cryptographic Hash Table
Indeterminate
<!-- Determinate Progress -->
<div class="as-progress" role="progressbar" aria-valuenow="68" aria-valuemin="0" aria-valuemax="100" aria-label="Compression">
<span class="as-progress__bar" style="width: 68%;"></span>
</div>
<!-- Indeterminate Progress -->
<div class="as-progress as-progress--indeterminate" role="progressbar" aria-label="Syncing">
<span class="as-progress__bar"></span>
</div> # Aster Component Implementation Prompt — Progress ## 1. Component Purpose & Canonical Role - **Component:** Progress (`progress`) - **Category:** Data Display - **Native Element:** `<div role="progressbar">` - **Summary:** Shows how far along a task is. - **When to Use:** Migrations, uploads, snapshots, and multi-step jobs. - **When Not to Use:** Inline button loading states (use Button spinner). ## 2. Authoritative Repository Files - **Component CSS:** `components/progress/progress.css` - **Component Spec:** `docs/components/progress.md` - **Agent Contract:** `skills/using-aster-components/SKILL.md` - **Compiled Bundle:** `dist/css/aster.css` and `dist/js/aster.js` ## 3. Canonical HTML Structure & Classes ```html <!-- Determinate Progress --> <div class="as-progress" role="progressbar" aria-valuenow="68" aria-valuemin="0" aria-valuemax="100" aria-label="Compression"> <span class="as-progress__bar" style="width: 68%;"></span> </div> <!-- Indeterminate Progress --> <div class="as-progress as-progress--indeterminate" role="progressbar" aria-label="Syncing"> <span class="as-progress__bar"></span> </div> ``` ## 4. Measured Geometry Measured from the rendered component when this page loads. ## 5. Non-Negotiable Aster Constraints 1. **Zero Primitive Color Leaks:** Bind colors strictly to `--as-semantic-color-*` custom properties. Never use `--as-color-primitive-*` or hardcoded hex values in component usage. 2. **Minimum 4px Radius Policy:** Never use `2px` border-radius. Use `--as-radius-sm` (`4px`), `--as-radius-md` (`8px`), `--as-radius-lg` (`12px`), or `--as-radius-full` (`9999px`). 3. **Single Standard Density Mode:** Compact mode (`data-density="compact"` / `.as-*--compact`) is permanently retired. Do not emit compact classes or attributes. 4. **WCAG 2.2 AA Accessibility:** Maintain >= 4.5:1 text contrast, >= 3:1 UI/border contrast, >= 24x24px interactive hit targets, and full keyboard operability (`Tab`, `Enter`, `Space`, `Escape`, Arrow keys). ## 6. Verification Commands ```bash npm run test:components npm run test:contrast npm run test:browser ```
When to use it
Do
- Show a percentage when you know it.
- Name the task in the label.
Don't
- Use it for very quick actions.
- Let the bar move backward without explanation.
Variants & States
Every option, rendered live with real styles.
Accessibility & Keyboard Interaction
Requirements for using this component accessibly, following the W3C ARIA Authoring Practices Guide.
| Interaction / Key | Behavior & Compliance Requirement |
|---|---|
| Progressbar Role | Declares role="progressbar" and accessible label. |
| Reduced Motion | Indeterminate animation collapses to static bar under reduced motion. |
Tokens
Values update with the current theme.
| Role | Token | Current value |
|---|---|---|
| Fill Bar | --as-semantic-color-interactive-primary | |
| Track Surface | --as-semantic-color-surface-muted |