Components · Feedback
Progress
A determinate progress indicator — completion, upload, a quiz timer — as a line, segmented steps, or a circle.
Examples
Type
Status
Percent
Line · steps · circle — default fill + status colours
<!-- Paste-and-run: save as .html and open in a browser. No build step.
<aha-progress> is the SAME shared custom element React and Vue consume — here in its
native form. Theming comes only from the --aha-* tokens in tokens.css.
type: line (default) | circle · size: default | small · steps: N (segmented line) ·
status: default | active | success | warning | exception · show-info="false" hides the label. -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/ahaslides-product/ahaslides-design@master/lib/tokens.css">
<script type="module">
import 'https://cdn.jsdelivr.net/gh/ahaslides-product/ahaslides-design@master/lib/icons.js'; // <aha-icon> for the status glyph
import 'https://cdn.jsdelivr.net/gh/ahaslides-product/ahaslides-design@master/lib/aha-progress.js'; // registers <aha-progress>
</script>
<div style="display:flex; flex-direction:column; gap:16px; max-width:320px">
<aha-progress percent="30"></aha-progress>
<aha-progress percent="70" status="warning"></aha-progress>
<aha-progress percent="100" status="success"></aha-progress>
<aha-progress size="small" percent="50"></aha-progress>
<aha-progress steps="5" percent="60"></aha-progress>
<aha-progress type="circle" percent="75"></aha-progress>
</div>
import '@ahaslides-product/design/aha-progress'; // registers <aha-progress>
import '@ahaslides-product/design/icons'; // registers <aha-icon> for the status glyph
// Attributes only — no events — so React 18/19 can render the element directly.
function AhaProgress({ percent, status, type, size, steps }) {
return <aha-progress percent={percent} status={status} type={type} size={size} steps={steps} />;
}
// usage
<AhaProgress percent={uploaded} status={failed ? 'exception' : 'default'} />
<AhaProgress type="circle" percent={score} status="success" />
<AhaProgress steps={5} percent={stepPct} size="small" />
// main.ts — register the elements + mark aha-* as custom elements
import '@ahaslides-product/design/aha-progress';
import '@ahaslides-product/design/icons'; // <aha-icon> for the status glyph
app.config.compilerOptions.isCustomElement = (tag) => tag.startsWith('aha-');
// Component.vue
<script setup>
import { ref } from 'vue';
const uploaded = ref(70);
const score = ref(75);
</script>
<template>
<aha-progress :percent="uploaded" status="success" />
<aha-progress type="circle" :percent="score" />
<aha-progress :steps="5" :percent="uploaded" size="small" />
</template>
API
| Prop | Type | Default | Notes |
|---|---|---|---|
percent | number | 0 | Completion 0–100; clamped and drives the fill |
type | 'line' | 'circle' | line | Shape: horizontal bar or SVG ring |
steps | number | 0 | Split a line into N discrete segments (line type only) |
size | 'default' | 'small' | default | Compact Mini variant (thinner bar / smaller ring) |
status | default | active | success | warning | exception | default | Fill colour (exception aliases error) |
show-info | boolean | true | Show the trailing percent/glyph label (set 'false' to hide) |
Install
# .npmrc — once: point the @ahaslides-product scope at GitHub Packages
@ahaslides-product:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN} # a GitHub token with read:packages
npm i @ahaslides-product/design
import '@ahaslides-product/design/tokens.css'; // once, at the app root
import '@ahaslides-product/design/aha-progress'; // registers <aha-progress>
Agent feed for this component (absolute, fetchable anywhere): progress.agent.json · progress.md · progress.llms.txt
When to use
When to use
- Progress — a determinate task with a known percentage (upload, steps, a timer)
- Spin — an indeterminate wait with no measurable percentage
- Skeleton — content is loading and you want to hold its layout
Use Progress only when you can measure completion. A line for inline flow, steps for a discrete multi-stage task, a circle for a compact score dial. Let the fill colour carry success/exception, not a separate label. For an indeterminate wait use Spin.
Surfaces
editor dashboard audience
Spec
Track line height 8 (small 6) · radius pill · #F1F1F1 · Fill default primary #6A1EBB · width (line) or stroke-dashoffset (circle) = percent · Type line (default) · circle (SVG ring, box 96 / small 40) · Steps steps=N → N equal segments, first round(percent) filled · Status active primary · success #16C49A · warning #FF7747 · exception #F5222D · Motion width / stroke-dashoffset animate on --aha-motion-slow / --aha-ease-out · Info percent label (✓/✕ glyph at success/exception); hide with show-info=false · A11y role=progressbar · aria-valuemin 0 / valuemax 100 / valuenow synced to percent