Progress

Display the current progress of the operation.
Importimport{ Progress }from"antd";

When To Use

If it will take a long time to complete an operation, you can use Progress to show the current progress and status.

  • When an operation will interrupt the current interface, or it needs to run in the background for more than 2 seconds.
  • When you need to display the completion percentage of an operation.

Examples

30%
50%

A standard progress bar.

CodeSandbox Icon
codepen icon
External Link Icon
expand codeexpand code
30%
50%

Appropriate for a narrow area.

CodeSandbox Icon
codepen icon
External Link Icon
expand codeexpand code
30%

A smaller circular progress bar.

CodeSandbox Icon
codepen icon
External Link Icon
expand codeexpand code
75 Days
Done

You can set a custom text by setting the format prop.

CodeSandbox Icon
codepen icon
External Link Icon
expand codeexpand code
60%
60%
60%

Show several parts of progress with different status.

CodeSandbox Icon
codepen icon
External Link Icon
expand codeexpand code
99.9%
50%
90%
93%
90%
93%

Gradient encapsulation, circle and dashboard will ignore strokeLinecap when setting gradient.

CodeSandbox Icon
codepen icon
External Link Icon
expand codeexpand code
Custom count:
Custom gap:
50%

A circular progress bar that support steps and color segments, default gap is 2px.

CodeSandbox Icon
codepen icon
External Link Icon
expand codeexpand code
5.16.0
0%
10%
50%
60%
100%
60%
60%

Change the position of the progress value, you can use percentPosition to adjust it so that the progress bar value is inside, outside or at the bottom of the progress bar.

CodeSandbox Icon
codepen icon
External Link Icon
expand codeexpand code
5.18.0
75%

A circular progress bar.

CodeSandbox Icon
codepen icon
External Link Icon
expand codeexpand code
代码发布

Responsive circular progress bar. When width is smaller than 20, progress information will be displayed in Tooltip.

CodeSandbox Icon
codepen icon
External Link Icon
expand codeexpand code
0%
0%

A dynamic progress bar is better.

CodeSandbox Icon
codepen icon
External Link Icon
expand codeexpand code
75%
75%

By setting type=dashboard, you can get a dashboard style of progress easily. Modify gapDegree to set the degree of gap.

CodeSandbox Icon
codepen icon
External Link Icon
expand codeexpand code
75%
75%
75%

By setting strokeLinecap="butt", you can change the linecaps from round to butt, see stroke-linecap for more information.

CodeSandbox Icon
codepen icon
External Link Icon
expand codeexpand code
50%
30%
60%

A progress bar with steps.

CodeSandbox Icon
codepen icon
External Link Icon
expand codeexpand code
50%
50%
50%
50%
50%
50%
50%
50%
50%
50%
50%

The size of progress.

CodeSandbox Icon
codepen icon
External Link Icon
expand codeexpand code

API

Common props ref:Common props

Properties that shared by all types.

PropertyDescriptionTypeDefaultVersion
formatThe template function of the contentfunction(percent, successPercent)(percent) => percent + %-
percentTo set the completion percentagenumber0-
showInfoWhether to display the progress value and the status iconbooleantrue
statusTo set the status of the Progress, options: success exception normal active(line only)string-
strokeColorThe color of progress barstring--
strokeLinecapTo set the style of the progress linecapround | butt | square, see stroke-linecapround-
successConfigs of successfully progress bar{ percent: number, strokeColor: string }--
trailColorThe color of unfilled partstring--
typeTo set the type, options: line circle dashboardstringline
sizeProgress sizenumber | [number | string, number] | { width: number, height: number } | "small" | "default""default"5.3.0, Object: 5.18.0

type="line"

PropertyDescriptionTypeDefaultVersion
stepsThe total step countnumber--
roundingThe function to round the value(step: number) => numberMath.round5.24.0
strokeColorThe color of progress bar, render linear-gradient when passing an object, could accept string[] when has steps.string | string[] | { from: string; to: string; direction: string }-4.21.0: string[]
percentPositionProgress value position, passed in object, align indicates the horizontal position of the value, type indicates whether the value is inside or outside the progress bar{ align: string; type: string }{ align: "end", type: "outer" }5.18.0

type="circle"

PropertyDescriptionTypeDefaultVersion
stepsThe total step count.When passing an object, count refers to the number of steps, and gap refers to the distance between them.When passing number, the default value for gap is 2.number | { count: number, gap: number }-5.16.0
strokeColorThe color of circular progress, render gradient when passing an objectstring | { number%: string }--
strokeWidthTo set the width of the circular progress, unit: percentage of the canvas widthnumber6-

type="dashboard"

PropertyDescriptionTypeDefaultVersion
stepsThe total step count.When passing an object, count refers to the number of steps, and gap refers to the distance between them.When passing number, the default value for gap is 2.number | { count: number, gap: number }-5.16.0
gapDegreeThe gap degree of half circle, 0 ~ 295number75
gapPositionThe gap position, options: top bottom left rightstringbottom
strokeWidthTo set the width of the dashboard progress, unit: percentage of the canvas widthnumber6

Design Token

Component TokenHow to use?

Token NameDescriptionTypeDefault Value
circleIconFontSizeIcon size of circular progress barstring1.1666666666666667em
circleTextColorText color of circular progress barstringrgba(0,0,0,0.88)
circleTextFontSizeText size of circular progress barstring1em
defaultColorDefault color of progress barstring#1677ff
lineBorderRadiusBorder radius of line progress barnumber100
remainingColorColor of remaining part of progress barstringrgba(0,0,0,0.06)

Global TokenHow to use?