JGuang

ProgressBar

ProgressBar · Ant Design Mobile

Preview
npm install antd-mobile@5.43.0

ProgressBar

Percentage progress is represented as a bar graph.

Install

npm install antd-mobile@5.43.0

antd-mobile is for mobile web, not React Native or Mini Programs. React 19 projects must register createRoot with unstableSetRender at the entry, or imperative APIs such as Toast and Dialog cannot render. Switch dark mode with <html data-prefers-color-scheme="dark">.

Examples come from the official Ant Design Mobile repository (MIT) at the commit published as npm 5.43.0. Presentation helpers such as DemoBlock are JGuang rewrites, not antd-mobile APIs.

Percentage progress is represented as a bar graph.

When to Use

It is suitable for displaying the current progress of the task.

Demos

ProgressBar

Props

NameDescriptionTypeDefault
percentPercent of the progress barnumber0
roundedWhether to round the cornersbooleantrue
textWhether to display progress text, support custom rendering contentboolean | ReactNode | ((percent: number) => ReactNode)false

CSS Variables

NameDescriptionDefaultGlobal
--fill-colorThe color of fill part.var(--adm-color-primary)--adm-progress-bar-fill-color
--track-colorThe color of line.var(--adm-color-border)--adm-progress-bar-track-color
--track-widthThe width of line.8px--adm-progress-bar-track-width
--text-widthThe width of text content.40px--adm-progress-bar-text-width