Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

rc-progress

react-component6.8mMIT4.0.0TypeScript support: included

progress ui component for react

react, react-component, react-progress, progress

readme

rc-progress

Progress Bar.

NPM version dumi build status Test coverage npm download bundle size

Example

https://progress.react-component.vercel.app/

Screenshots

Browsers

  • support IE9+, Chrome, Firefox, Safari

Install

rc-progress

Usage

import { Line, Circle } from 'rc-progress';

export default () => (
  <>
     <Line percent={10} strokeWidth={4} strokeColor="#D3D3D3" />
     <Circle percent={10} strokeWidth={4} strokeColor="#D3D3D3" /> 
  </>
);

Compatibility

IE / Edge
IE / Edge
Firefox
Firefox
Chrome
Chrome
Safari
Safari
Electron
Electron
IE11, Edge last 2 versions last 2 versions last 2 versions last 2 versions

API

props

name type default description
strokeWidth Number 1 Width of the stroke. Unit is percentage of SVG canvas size.
strokeColor String #2db7f5 Stroke color.
trailWidth Number 1 Width of the trail stroke. Unit is percentage of SVG canvas size. Trail is always centered relative to actual progress path. If trailWidth is not defined, it is the same as strokeWidth.
trailColor String #D9D9D9 Color for lighter trail stroke underneath the actual progress path.
strokeLinecap String 'round' The shape to be used at the end of the progress bar: can be `butt`, `square` or `round`.
prefixCls String rc-progress prefix className for component
className String customized className
style Object style object will be added to svg element
percent Number | Number[] 0 the percent of the progress
gapDegree Number 0 the gap degree of half circle, 0 - 360
gapPosition String top the gap position: can be `top`, `bottom`, `left`, or `right`.

Installation

npm install --save rc-progress

Development

npm install
npm start

License

rc-progress is released under the MIT license.

changelog

Changelog

3.1.3

2021.01.08

  • fix: add opacity transition. #96
  • chore: use github actions. #97
  • chore: use dumi. #98

3.1.2

2020.12.29

  • fix: line progress percentage. #94

3.1.1

2020.10.21

  • chore: support react 17. #87

3.1.0

2020-09-01

  • chore: use father. #85

3.0.0

  • Refactor to hooks.

2.5.0

  • Progress.Circle supports gradient color now. #73

2.4.0

  • publish TypeScript typings to the npm registry.
  • fixed progress order in percent list.
  • Add transition prop.

2.3.0

  • percentage & strokeColor can now use array of value.

2.2.0

  • when circle percent == 0, make stroke not visible

2.1.0

  • Add gapDegree gapPosition props.

2.0.0

  • refactor code
  • Add prefixCls className style props.
  • Add strokeLinecap for shape of end in progress bar.