Ant Design Svelte

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

30%
50%

Line states

Normal, active, erroneous and completed progress.

75%
30%
50%

Circles and adaptability

Conditions, small size and Tooltip for a miniature circle.

30%
50%

Thin line

Small size for narrow area.

42.5%
42.5%

Change progress

General fields control line and circle.

75 days
Ready

Label format

Text and Snippet with separate available value.

75%

Dashboard

Angle of break and its logical position.

60%
75%
75%

Successful segment

General and successfully verified scope of work.

round

60%
75%

butt

60%
75%

square

60%
75%

Line terminations

round, butt and square.

80%
90%
90%

Gradients

Color transitions for line, circle and panel.

60%
60%
59%
60%
60%

Progress in steps

Linear and circular segments, colors and rounding.

50%
50%
50%
50%

Dimensions

Line width and height, circle diameter and thickness.

60%
60%
60%
60%
60%
60%

Value position

Three alignments inside and outside the line.

60%
70%

Semantic DOM

Object, style function and general provider settings.

60%
60%

Tokens and RTL

Component tokens in a nested topic.

API

Scripts are mapped to sixteen ant.design 6.7.0 themes and public types of the Svelte package.

Example themes
ThemeExample or limitation
Progress barFive states of the linear indicator.
Circular progress barOrdinary circle, error and success.
Mini size progress barThin line.
Responsive circular progress barContainer compression; Tooltip with a diameter of up to 20px.
Mini size circular progress barsmall and numerical diameter.
DynamicChange percentage, status and label.
Custom text formatText and Svelte Snippet.
DashboardAngle and position of the break.
Progress bar with success segmentSuccessful part of the overall operation.
Stroke LinecapThree ending forms.
Custom line gradientLinear and SVG gradients.
Progress bar with stepsStep colors and rounding.
Circular progress bar with stepsNumber of segments and clearance.
Progress sizeNumber, array and size object.
Change progress value positionstart, center and end inside/outside.
Custom semantic dom stylingObject and function with props.

Progress

PropertyDescriptionTypeDefault
prefixClsFull local CSS prefix for line, circle, and Progress states. The empty string and undefined inherit ConfigProvider.prefixCls; default is ant-progress.stringConfigProvider + -progress
typeIndicator geometry.line | circle | dashboardline
percentCompleted beat in the range 0–100.number0
statusActive animates only the line.normal | active | exception | successby percent
showInfoDisplay status text or icon.booleantrue
formatText, number or Snippet label.(percent, successPercent?) => ProgressContentpercent
sizeThe object is applied to a line; The number next to the circle specifies the diameter.small | medium | number | [width, height] | {width, height}medium
strokeWidthThe thickness of the circle/dashboard arc as a percentage of the SVG diameter. For line, the height is specified via size.number6
strokeColorColor, linear step color array or gradient.string | string[] | ProgressGradienton topic
railColorColor of the remaining part.stringon topic
strokeLinecapLine termination; An SVG gradient uses its own geometry.round | butt | squareround
successAdditional successfully completed segment.{percent?, strokeColor?}—
stepsSegments; gap refers to circular steps.number | {count, gap}—
roundingRounds the number of active linear steps.(value: number) => numberMath.round
percentPositionContinuous line label position.{align: start | center | end, type: inner | outer}end / outer
gapDegreeDashboard break angle, 0–295.number75 at dashboard
gapPlacementLogical position of the break taking into account RTL.top | bottom | start | endbottom
classNamesSemantic slots classes.ProgressSemanticSlots | callback—
stylesCSS 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.

Progress
SlotPurpose
rootRoot with available value.
bodyLine container or SVG.
railRemaining part; missing from steps.
trackFilled part or segments.
indicatorText 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.

TokenPurpose
defaultColorColor of the filled part.
remainingColorResidue color.
circleTextColorCircular label color.
lineBorderRadiusLine rounding.
circleTextFontSizeCircle text size.
circleIconFontSizeCircle icon size.
Common tokens of the current topic
TokenMeaning
colorError#ff4d4f
colorSuccess#52c41a
colorTextrgba(0,0,0,0.88)
colorBgContainer#ffffff
fontSize14
lineHeight1.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.