--- localeCode: en-US order: 85 category: Feedback title: Progress subTitle: Progress icon: doc-progress width: 60% brief: Used to display the current progress and status of the user operation, and is generally used when the operation takes a long time. Can also be used to indicate the degree of completion of a task/object --- ## Demos ### How to import ```jsx import { Progress } from '@douyinfe/semi-ui'; ``` ### Standard progress bar Use `stroke` Property to control the filling color of the progress bar Use `Percent` Property to control completed progress Use `size` Property control progress bar size Use `aria-label` Property to explain the specific role If the preset size is not satisfied, You can pass height to customize the height of the progress bar through `style` property. ```jsx live=true import React from 'react'; import { Progress } from '@douyinfe/semi-ui'; () => (





); ``` ### Show percentage text You can control whether to show percentage number through the `showInfo` property In addition, you can format the percentage text show through `format`. ```jsx live=true import React from 'react'; import { Progress } from '@douyinfe/semi-ui'; () => (



percent * 10 + '‰'} aria-label="disk usage"/>
); ``` ### Vertical progress bar You can use vertical progress bar by setting `direction='vertical'` If preset width is not satisfied, you can pass width to customize the width of the vertical progress bar through `style` property. ```jsx live=true import React from 'react'; import { Progress } from '@douyinfe/semi-ui'; () => (
); ``` ### Circular progress bar Set type to`circle`, the progress bar will be displayed in a ring shape. The default size of the progress bar is 72 x 72 ```jsx live=true import React from 'react'; import { Progress } from '@douyinfe/semi-ui'; () => (
); ``` You can modify it's `width` to control the size of the circular progress bar. ```jsx live=true import React from 'react'; import { Progress } from '@douyinfe/semi-ui'; () => (
); ``` ### Small circular progress bar Small progress bar default size is 24 x 24. ```jsx live=true import React from 'react'; import { Progress } from '@douyinfe/semi-ui'; () => ( ); ``` ### Dynamic change percent ```jsx live=true import React from 'react'; import { Progress, Button } from '@douyinfe/semi-ui'; import { IconChevronLeft, IconChevronRight } from '@douyinfe/semi-icons'; () => { const [percent, setPercent] = useState(40); return ( <>
); }; ``` ```jsx live=true import React from 'react'; import { Progress, Button } from '@douyinfe/semi-ui'; import { IconChevronLeft, IconChevronRight } from '@douyinfe/semi-icons'; () => { const [cirPerc, setCirPerc] = useState(40); return (
); }; ``` ### Custom central text content You can customize the central text by passing `format` function, and the argument of the format is the current percentage If you don't need central text content, you can set `showInfo` to false or return an empty string directly in `format` ```jsx live=true import React from 'react'; import { Progress } from '@douyinfe/semi-ui'; () => ( per + 'Days'} style={{ margin: 10 }} aria-label="disk usage"/> 'Done'} style={{ margin: 10 }} aria-label="disk usage"/> ); ``` ### Round / square edges With the `strokeLinecap` property, you can control the edge shape of the ring progress bar. ```jsx live=true import React from 'react'; import { Progress } from '@douyinfe/semi-ui'; () => ( ); ``` ### Customise the progress bar color The color of a specific `percent` can be customised by setting the `stroke` property ```jsx live=true import React, { useState } from 'react'; import { Progress, Button } from '@douyinfe/semi-ui'; import { IconChevronLeft, IconChevronRight } from '@douyinfe/semi-icons'; () => { const [percent, setPercent] = useState(10); const strokeArr = [ { percent: 20, color: 'red' }, { percent: 40, color: 'orange-9' }, { percent: 60, color: 'light-green-8' }, { percent: 80, color: 'hsla(125, 50%, 46% / 1)' } ]; return ( <>