Progress
Display the current progress of the operation.
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
- Progress bar ·
line - Circular progress bar ·
circle - Mini size progress bar ·
line-mini - Responsive circular progress bar ·
circle-micro - Mini size circular progress bar ·
circle-mini - Dynamic ·
dynamic - Custom text format ·
format - Dashboard ·
dashboard - Progress bar with success segment ·
segment - Stroke Linecap ·
linecap - Custom line gradient ·
gradient-line - Progress bar with steps ·
steps - Circular progress bar with steps ·
circle-steps - Progress size ·
size - Change progress value position ·
info-position - Custom semantic dom styling ·
style-class
API
Common props ref:Common props
Properties that shared by all types.
| Property | Description | Type | Default | Version | Global Config |
|---|---|---|---|---|---|
| classNames | Customize class for each semantic structure inside the component. Supports object or function. | Record<SemanticDOM, string> | (info: { props })=> Record<SemanticDOM, string> | - | 6.0.0 | 6.0.0 |
| format | The template function of the content | function(percent, successPercent) | (percent) => percent + % | - | × |
| percent | To set the completion percentage | number | 0 | - | × |
| railColor | The color of unfilled part | string | - | - | × |
| showInfo | Whether to display the progress value and the status icon | boolean | true | - | × |
| status | To set the status of the Progress, options: success exception normal active(line only) | string | - | - | × |
| strokeColor | The color of progress bar | string | - | - | × |
| strokeLinecap | To set the style of the progress linecap | round | butt | square, see stroke-linecap | round | - | × |
| styles | Customize inline style for each semantic structure inside the component. Supports object or function. | Record<SemanticDOM, CSSProperties> | (info: { props })=> Record<SemanticDOM, CSSProperties> | - | 6.0.0 | 6.0.0 |
| success | Configs of successfully progress bar | { percent: number, strokeColor: string } | - | - | × |
The color of unfilled part. Please use railColor instead | string | - | - | × | |
| type | To set the type, options: line circle dashboard | string | line | - | × |
| size | Progress size | number | [number | string, number] | { width: number, height: number } | "small" | "medium" | "medium" | 5.3.0, Object: 5.18.0 | × |
type="line"
| Property | Description | Type | Default | Version |
|---|---|---|---|---|
| steps | The total step count | number | - | - |
| rounding | The function to round the value | (step: number) => number | Math.round | 5.24.0 |
| strokeColor | The 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[] |
| percentPosition | Progress 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"
| Property | Description | Type | Default | Version |
|---|---|---|---|---|
| steps | The total step count. When passing an object, count refers to the number of steps, and gap refers to the distance between them. When passing a number, the default value for gap is 2. | number | { count: number, gap: number } | - | 5.16.0 |
| strokeColor | The color of circular progress, render gradient when passing an object | string | { number%: string } | - | - |
| strokeWidth | To set the width of the circular progress, unit: percentage of the canvas width | number | 6 | - |
type="dashboard"
| Property | Description | Type | Default | Version |
|---|---|---|---|---|
| steps | The total step count. When passing an object, count refers to the number of steps, and gap refers to the distance between them. When passing a number, the default value for gap is 2. | number | { count: number, gap: number } | - | 5.16.0 |
| gapDegree | The gap degree of half circle, 0 ~ 295 | number | 75 | - |
| gapPlacement | The gap placement, options: top bottom start end | string | bottom | - |
The gap position, options: top bottom left right, please use gapPlacement instead | string | bottom | - | |
| strokeWidth | To set the width of the dashboard progress, unit: percentage of the canvas width | number | 6 | - |
Semantic DOM
| Semantic node | Native description | Version |
|---|---|---|
root | Root element, set relative positioning and basic container styles | — |
body | Body element, set progress bar layout and size styles | — |
rail | Rail element, set background track color and border radius styles. Not exist in steps mode | — |
track | Track element, set progress fill color and transition animation styles | — |
indicator | Indicator element, set percentage text or icon position and font styles | — |
Semantic description source: vendor/components/progress/demo/_semantic.tsx
Design Token
Types, inheritance and declarations retain the pinned native source. Defaults are computed by the native theme and may be overridden by ConfigProvider; this table does not invent static defaults.
| Token | Type | Native description |
|---|---|---|
defaultColor | string | Default color of progress bar |
remainingColor | string | Color of remaining part of progress bar |
circleTextColor | string | Text color of circular progress bar |
lineBorderRadius | number | Border radius of line progress bar |
circleTextFontSize | string | Text size of circular progress bar |
circleIconFontSize | string | Icon size of circular progress bar |
Declaration source: vendor/components/progress/style/index.ts
import type { CSSObject } from '@ant-design/cssinjs';
import { Keyframes } from '@ant-design/cssinjs';
import { resetComponent } from '../../style';
import type { FullToken, GenerateStyle, GetDefaultToken } from '../../theme/internal';
import { genStyleHooks, mergeToken } from '../../theme/internal';
export interface ComponentToken {
/**
* @desc 进度条默认颜色
* @descEN Default color of progress bar
*/
defaultColor: string;
/**
* @desc 进度条剩余部分颜色
* @descEN Color of remaining part of progress bar
*/
remainingColor: string;
/**
* @desc 圆形进度条文字颜色
* @descEN Text color of circular progress bar
*/
circleTextColor: string;
/**
* @desc 条状进度条圆角
* @descEN Border radius of line progress bar
*/
lineBorderRadius: number;
/**
* @desc 圆形进度条文本大小
* @descEN Text size of circular progress bar
*/
circleTextFontSize: string;
/**
* @desc 圆形进度条图标大小
* @descEN Icon size of circular progress bar
*/
circleIconFontSize: string;
}
/**
* @desc Progress 组件的 Token
* @descEN Token for Progress component
*/
interface ProgressToken extends FullToken<'Progress'> {
/**
* @desc 进度步骤最小宽度
* @descEN Minimum width of progress step
*/
progressStepMinWidth: number | string;
/**
* @desc 进度步骤右间距
* @descEN Right margin of progress step
*/
progressStepMarginInlineEnd: number | string;
/**
* @desc 进度条动画持续时间
* @descEN Duration of progress bar animation
*/
progressActiveMotionDuration: string;
}
Shared native props
Tips: The following generic properties apply to most antd components; those not supported are described separately.
| Property | Description | Type | Default |
|---|---|---|---|
| style | The additional style | CSSProperties | - |
| className | The additional css class | string | - |
| rootClassName | ClassName on the root element | string | - |
| autoFocus | Auto focus when component mounted, only effective for focusable elements like forms, links, etc. | boolean | false |
Install and reproduce an example
npm install antd@6.6.5 @ant-design/icons@6.3.4 dayjs@1.11.23
Use ConfigProvider and native App; configure dayjs locale separately. Each example lists its complete source files and additional pinned dependencies in View code. Example names select demos, not universal component props. See the resource setup guide for theme, locale and SSR.
Native type references
The source viewer includes unchanged native implementations and the following source declarations. Inherited types remain in their native packages. English source comments are preserved as code reference.
vendor/components/progress/Circle.tsxvendor/components/progress/Line.tsxvendor/components/progress/Steps.tsxvendor/components/progress/progress.tsxvendor/components/progress/style/index.ts
Source and license
https://github.com/ant-design/ant-design/tree/4a39f54842eade4e565ab336ef6097cd7e723cdd
Original bilingual prose and executable examples are retained. Website-only embeds and token tables are expanded locally. Ant Design is MIT; separately listed dependency notices also apply. Upload previews block outbound requests and do not provide a backend.