Progress
Linear, circular and segment progress: states, gradients and dimensions.
When to use
Progress shows the measurable amount of work completed and its status. It is suitable for loading a file, processing records and executing a plan. If the percentage is unknown, use Spin; The active animation itself does not measure the request.
Percentage, status and successful part of
percent sets a value from 0 to 100. status selects normal/active/exception/success; active animation refers to a line. success.percent shows the successfully verified part separately, success.strokeColor changes its color.
| Problem | Setting | Example |
|---|---|---|
| Show volume and condition | percent, status |
Linear progress |
| Place value in circle | type="circle" |
Circles |
| Add scale break | type="dashboard", gapDegree |
Panel |
| Separate the checked part | success |
Successful segment |
| Break the work into segments | steps, rounding |
Steps |
| Customize result text | format |
Signature |
format receives percent and successPercent and returns text or snippet. showInfo hides the visible label, but does not override the available progressbar value. For a custom text result, specify aria-valuetext and the name of the operation via aria-label.
Geometry, colors and text position
type selects line/circle/dashboard. The dimensions of the line determine its width and height; for a circle, the number determines the diameter, strokeWidth determines the thickness. Do not wrap strokeWidth to line: this option has been removed from current types.
railColor decorates the unfilled area, strokeColor decorates the filling. Normal color, gradient, and array colors are allowed for supported segment scenarios. circle/dashboard with gradient ignore strokeLinecap as shown in the official script.
Steps accepts a number or a count/gap object. rounding specifies the rounding of the segment value; This is not a rounding of the original transaction data. gapPlacement uses top/bottom/start/end, percentPosition - inner/outer and start/center/end to label the line.
For a circle with a numeric diameter of 20 px or less, hover over it to see the label. The label uses the tooltip’s text color. Screen readers can read the current value before the tooltip opens.
Update and design
The percentage comes from the application. Update it based on the actual amount of work; If you make an error, keep a clear explanation and retry action. The demos change values with fields and buttons, without a background simulating timer.
ConfigProvider.progress sets the general class/style and semantic defaults. Root/body/rail/track/indicator are formatted as an object or callback; styles contains CSS strings. Progress component design tokens are applied through the theme and inherit common typography and colors.
Prefers-reduced-motion disables transitions and active motion. Accompany the status change with the text: exception-red or success-green alone does not sufficiently explain the result. bind:nativeElement provides the root div after the mount.
A non-empty local prefixCls specifies the Progress CSS classes; the empty string and undefined inherit ConfigProvider.prefixCls with the -progress suffix, defaulting to ant-progress. Percentage, SVG ids, semantic styles and namespace CSS variables are preserved across updates. Example ConfigProvider shows the common prefix.
Examples
Line states
Normal, active, erroneous and completed progress.
<script lang="ts">
import { Progress } from '@woodger/antd';
</script>
<style>
.examples {
display: grid;
gap: 16px;
}
</style>
<div class="examples">
<Progress percent={30} aria-label={("Normal task")} />
<Progress percent={50} status="active" aria-label={("Active task")} />
<Progress percent={70} status="exception" aria-label={("Task error")} />
<Progress percent={100} aria-label={("Ready task")} />
<Progress percent={50} showInfo={false} aria-label={("Without label")} />
</div>
Circles and adaptability
Conditions, small size and Tooltip for a miniature circle.
<script lang="ts">
import { Progress } from '@woodger/antd';
</script>
<style>
.examples {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 24px;
}
.responsive {
width: 100px;
max-width: 100%;
}
</style>
<div class="examples">
<Progress type="circle" percent={75} aria-label={("Circular problem")} />
<Progress type="circle" percent={70} status="exception" aria-label={("Circular error")} />
<Progress type="circle" percent={100} aria-label={("Finished in a circle")} />
<Progress type="circle" percent={30} size="small" aria-label={("Small circle")} />
<div class="responsive">
<Progress type="circle" percent={50} size={100} aria-label={("Adaptive circle")} />
</div>
<Progress type="circle" percent={60} size={18} aria-label={("Miniature circle")} />
</div>
Thin line
Small size for narrow area.
<script lang="ts">
import { Progress } from '@woodger/antd';
</script>
<style>
.examples {
display: grid;
gap: 16px;
}
</style>
<div class="examples">
<Progress percent={30} size="small" aria-label={("Small task")} />
<Progress percent={50} size="small" status="active" aria-label={("Small active task")} />
<Progress percent={100} size="small" aria-label={("Small ready task")} />
</div>
Change progress
General fields control line and circle.
<script lang="ts">
import {
Checkbox,
InputNumber,
Progress,
Select,
Slider,
type ProgressStatus
} from '@woodger/antd';
let percent = $state(42.5);
let status = $state<'auto' | ProgressStatus>('auto');
let size = $state<'small' | 'medium'>('medium');
let showInfo = $state(true);
let formatted = $state(false);
const format = (value: number) => `${value.toFixed(1)}%`;
const statuses = ['auto', 'normal', 'active', 'exception', 'success']
.map((value) => ({ value: value as typeof status, label: value }));
let resolvedStatus = $derived(status === 'auto' ? undefined : status);
</script>
<style>
.controls {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 12px;
margin-bottom: 24px;
}
.field { width: 150px; }
.preview {
display: grid;
grid-template-columns: minmax(0, 1fr) auto;
align-items: center;
gap: 24px;
}
.line { min-width: 0; }
.slider { margin-block: 24px; }
@media (max-width: 575px) {
.preview {
grid-template-columns: minmax(0, 1fr);
justify-items: center;
}
.line {
width: 100%;
}
}
</style>
<div class="controls">
<div class="field"><InputNumber
aria-label={("Percent Progress")}
min={0}
max={100}
step={0.5}
value={percent}
onValueChange={(value) => { percent = value ?? 0; }}
/></div>
<div
class="field"
><Select
aria-label={("Status Progress")}
bind:value={status}
options={(statuses)}
/></div>
<div class="field"><Select
aria-label={("Size Progress")}
bind:value={size}
options={([{ value: 'medium', label: 'medium' }, {
value: 'small',
label: 'small'
}])}
/></div>
<Checkbox
bind:checked={showInfo}
>{("Show Progress value")}</Checkbox><Checkbox
bind:checked={formatted}
>{("Fractional label Progress")}</Checkbox>
</div>
<div class="preview"><div class="line"><Progress
{percent}
{size}
{showInfo}
status={resolvedStatus}
format={formatted ? format : undefined}
aria-label={("Linear progress")}
/></div><Progress
type="circle"
{percent}
{size}
{showInfo}
status={resolvedStatus === 'active' ? undefined : resolvedStatus}
format={formatted ? format : undefined}
aria-label={("Circular progress")}
/></div>
<div class="slider"><Slider
aria-label={("Change Progress percentage")}
min={0}
max={100}
step={0.5}
value={percent}
onValueChange={(value) => { percent = value; }}
/></div>
Label format
Text and Snippet with separate available value.
<script lang="ts">
import { Progress } from '@woodger/antd';
</script>
<style>
.examples {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 24px;
}
.label { font-weight: 700; }
</style>
{#snippet label()}<span class="label">{("Ready")}</span>{/snippet}
<div class="examples">
<Progress
type="circle"
percent={75}
format={value => ("" + String((value)) + " days")}
aria-label={("Preparation")}
/>
<Progress
type="circle"
percent={100}
format={() => label}
aria-label={("Publication")}
aria-valuetext={("Ready")}
/>
</div>
Dashboard
Angle of break and its logical position.
<script lang="ts">
import { InputNumber, Progress, RadioGroup, type ProgressGapPlacement } from '@woodger/antd';
let gap = $state(75);
let placement = $state<ProgressGapPlacement>('bottom');
</script>
<style>
.settings {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 16px;
margin-bottom: 24px;
}
</style>
<div class="settings">
<InputNumber aria-label={("Break angle")} min={0} max={295} value={gap}
onValueChange={next => { gap = next ?? 0; }} />
<RadioGroup aria-label={("Break position")} bind:value={placement}
options={(['top', 'bottom', 'start', 'end'])} />
</div>
<Progress
type="dashboard"
percent={75}
gapDegree={gap}
gapPlacement={placement}
aria-label={("Progress bar")}
/>
Successful segment
General and successfully verified scope of work.
<script lang="ts">
import { Progress } from '@woodger/antd';
</script>
<style>
.examples {
display: grid;
gap: 24px;
}
.circles {
display: flex;
flex-wrap: wrap;
gap: 24px;
}
</style>
<div class="examples">
<Progress
percent={60}
success={{ percent: 30 }}
aria-label={("Download and check")}
/>
<div class="circles">
<Progress type="circle" percent={75} success={{ percent: 25 }} aria-label={("Circle with successful part")} />
<Progress
type="dashboard"
percent={75}
success={{ percent: 25, strokeColor: '#389e0d' }}
aria-label={("Panel with successful part")}
/>
</div>
</div>
round
butt
square
Line terminations
round, butt and square.
<script lang="ts">
import { Progress } from '@woodger/antd';
const caps = ['round', 'butt', 'square'] as const;
</script>
<style>
.examples {
display: grid;
gap: 24px;
}
.row {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 24px;
}
</style>
<div class="examples">
{#each caps as cap (cap)}
<div><p>{(cap)}</p><div class="row">
<Progress
percent={60}
strokeLinecap={cap}
aria-label={("Line " + String((cap)) + "")}
style="
width: 180px;
max-width: 100%;
"
/>
<Progress type="circle" percent={75} size={80} strokeLinecap={cap} aria-label={("Circle " + String((cap)) + "")} />
</div></div>
{/each}
</div>
Gradients
Color transitions for line, circle and panel.
<script lang="ts">
import { Progress } from '@woodger/antd';
const gradient = { '0%': '#d46b08', '100%': '#389e0d' };
</script>
<style>
.examples {
display: grid;
gap: 24px;
}
.row {
display: flex;
flex-wrap: wrap;
gap: 24px;
}
</style>
<div class="examples">
<Progress percent={80} strokeColor={{ from: '#d46b08', to: '#389e0d' }} aria-label={("Line gradient")} />
<div class="row">
<Progress type="circle" percent={90} strokeColor={gradient} aria-label={("Circle Gradient")} />
<Progress type="dashboard" percent={90} strokeColor={gradient} aria-label={("Gradient panel")} />
</div>
</div>
Progress in steps
Linear and circular segments, colors and rounding.
<script lang="ts">
import { Progress } from '@woodger/antd';
</script>
<style>
.examples {
display: grid;
gap: 24px;
}
.row {
display: flex;
flex-wrap: wrap;
gap: 24px;
}
</style>
<div class="examples">
<Progress percent={60} steps={(5)} aria-label={("Five steps")} />
<Progress percent={60} steps={(5)} strokeColor={[
'#d46b08',
'#d48806',
'#7cb305',
'#389e0d',
'#08979c'
]} aria-label={("Colored steps")} />
<Progress percent={59} steps={(5)} rounding={Math.floor} aria-label={("Rounding down")} />
<div class="row">
<Progress
type="circle"
percent={60}
steps={({ count: 5, gap: 4 })}
aria-label={("Steps in a circle")}
/>
<Progress type="dashboard" percent={60} steps={(8)} aria-label={("Panel Steps")} />
</div>
</div>
Dimensions
Line width and height, circle diameter and thickness.
<script lang="ts">
import { Progress } from '@woodger/antd';
</script>
<style>
.examples {
display: grid;
gap: 24px;
}
.row {
display: flex;
flex-wrap: wrap;
gap: 24px;
}
</style>
<div class="examples">
<Progress percent={50} size={[200, 12]} aria-label={("Line 200 by 12")} />
<Progress percent={50} size={{ width: '100%', height: 20 }} aria-label={("Full width line")} />
<div class="row">
<Progress type="circle" percent={50} size={80} strokeWidth={10} aria-label={("Circle 80")} />
<Progress type="dashboard" percent={50} size={80} strokeWidth={10} aria-label={("Panel 80")} />
</div>
</div>
Value position
Three alignments inside and outside the line.
<script lang="ts">
import { Progress } from '@woodger/antd';
const types = ['inner', 'outer'] as const;
const alignments = ['start', 'center', 'end'] as const;
</script>
<style>
.examples {
display: grid;
gap: 24px;
}
</style>
<div class="examples">
{#each types as type (type)}
{#each alignments as align (align)}
<Progress percent={60} percentPosition={{ type, align }} size={type === 'inner' ? [
'100%',
24
] : 'medium'}
aria-label={("" + String((type)) + " " + String((align)) + "")} />
{/each}
{/each}
</div>
Semantic DOM
Object, style function and general provider settings.
<script lang="ts">
import { ConfigProvider, Progress } from '@woodger/antd';
</script>
<style>
.examples {
display: grid;
gap: 24px;
}
</style>
<ConfigProvider progress={{ styles: { root: 'padding: 12px' } }}>
<div class="examples">
<Progress percent={60} aria-label={("Styles object")} classNames={{
root: 'progress-object'
}}
styles={{
rail: 'background: #fff1b8',
track: 'background: #d48806',
indicator: 'font-weight: 700'
}} />
<Progress type="circle" percent={70} aria-label={("Styles function")}
classNames={{ root: 'progress-function' }}
styles={({ props }) => ({ indicator: props.percent >= 50 ? 'font-weight: 700' : '' })} />
</div>
</ConfigProvider>
Tokens and RTL
Component tokens in a nested topic.
<script lang="ts">
import { ConfigProvider, Progress } from '@woodger/antd';
</script>
<style>
.examples {
display: grid;
gap: 24px;
}
</style>
<ConfigProvider direction="rtl" theme={{ components: { Progress: {
defaultColor: '#d48806', remainingColor: '#fff1b8', lineBorderRadius: 4,
circleTextColor: '#874d00', circleTextFontSize: '1.1em', circleIconFontSize: '1.4em'
} } }}>
<div class="examples">
<Progress percent={60} aria-label={("Thematic line")} />
<Progress type="circle" percent={60} aria-label={("Thematic circle")} />
<Progress type="circle" percent={100} aria-label={("Thematic icon")} />
</div>
</ConfigProvider>
API
Scripts are mapped to sixteen ant.design 6.7.0 themes and public types of the Svelte package.
| Theme | Example or limitation |
|---|---|
| Progress bar | Five states of the linear indicator. |
| Circular progress bar | Ordinary circle, error and success. |
| Mini size progress bar | Thin line. |
| Responsive circular progress bar | Container compression; Tooltip with a diameter of up to 20px. |
| Mini size circular progress bar | small and numerical diameter. |
| Dynamic | Change percentage, status and label. |
| Custom text format | Text and Svelte Snippet. |
| Dashboard | Angle and position of the break. |
| Progress bar with success segment | Successful part of the overall operation. |
| Stroke Linecap | Three ending forms. |
| Custom line gradient | Linear and SVG gradients. |
| Progress bar with steps | Step colors and rounding. |
| Circular progress bar with steps | Number of segments and clearance. |
| Progress size | Number, array and size object. |
| Change progress value position | start, center and end inside/outside. |
| Custom semantic dom styling | Object and function with props. |
Progress
| Property | Description | Type | Default |
|---|---|---|---|
prefixCls | Full local CSS prefix for line, circle, and Progress states. The empty string and undefined inherit ConfigProvider.prefixCls; default is ant-progress. | string | ConfigProvider + -progress |
type | Indicator geometry. | line | circle | dashboard | line |
percent | Completed beat in the range 0–100. | number | 0 |
status | Active animates only the line. | normal | active | exception | success | by percent |
showInfo | Display status text or icon. | boolean | true |
format | Text, number or Snippet label. | (percent, successPercent?) => ProgressContent | percent |
size | The object is applied to a line; The number next to the circle specifies the diameter. | small | medium | number | [width, height] | {width, height} | medium |
strokeWidth | The thickness of the circle/dashboard arc as a percentage of the SVG diameter. For line, the height is specified via size. | number | 6 |
strokeColor | Color, linear step color array or gradient. | string | string[] | ProgressGradient | on topic |
railColor | Color of the remaining part. | string | on topic |
strokeLinecap | Line termination; An SVG gradient uses its own geometry. | round | butt | square | round |
success | Additional successfully completed segment. | {percent?, strokeColor?} | — |
steps | Segments; gap refers to circular steps. | number | {count, gap} | — |
rounding | Rounds the number of active linear steps. | (value: number) => number | Math.round |
percentPosition | Continuous line label position. | {align: start | center | end, type: inner | outer} | end / outer |
gapDegree | Dashboard break angle, 0–295. | number | 75 at dashboard |
gapPlacement | Logical position of the break taking into account RTL. | top | bottom | start | end | bottom |
classNames | Semantic slots classes. | ProgressSemanticSlots | callback | — |
styles | CSS lines semantic slots; callback receives props. | ProgressSemanticSlots | callback | — |
format returns text or Svelte Snippet. For Snippet with non-standard content, set aria-valuetext separately.
Semantic DOM
Root has role=progressbar, aria-valuenow and range 0–100. Indicator is hidden from re-reading. There is no separate rail in steps; circle uses SVG.
| Slot | Purpose |
|---|---|
root | Root with available value. |
body | Line container or SVG. |
rail | Remaining part; missing from steps. |
track | Filled part or segments. |
indicator | Text or icon inside the indicator. |
Registration tokens
ConfigProvider.theme.components.Progress sets six component tokens. For a single indicator, use strokeColor, railColor or semantic styles.
| Token | Purpose |
|---|---|
defaultColor | Color of the filled part. |
remainingColor | Residue color. |
circleTextColor | Circular label color. |
lineBorderRadius | Line rounding. |
circleTextFontSize | Circle text size. |
circleIconFontSize | Circle icon size. |
| Token | Meaning |
|---|---|
colorError | #ff4d4f |
colorSuccess | #52c41a |
colorText | rgba(0,0,0,0.88) |
colorBgContainer | #ffffff |
fontSize | 14 |
lineHeight | 1.5714285714285714 |
FAQ
What to show if the percentage is unknown?
Spin. Progress is needed for a measurable amount of work.
Why does the gradient change the ends of the circle?
circle/dashboard with gradient uses the appropriate SVG geometry and ignores strokeLinecap.
How to make a snippet understandable?
Specify aria-label for the operation and aria-valuetext for the text value. Otherwise, the available value remains a percentage.
What happens to the mini circle signature?
Hover over the tiny circle to see its label, such as 60%, in a tooltip.
How to turn off motion?
System prefers-reduced-motion disables transitions and active animation.