0.1.6 • Published 2 years ago

react-css-progress v0.1.6

Weekly downloads
1
License
ISC
Repository
github
Last release
2 years ago

使用css+react实现进度条

支持线状、半圆、整圆形式。

API

api类型是否必选默认值说明
typestringfalse'line'进度条不同形式,目前支持线状(line)、半圆(semicircle)、整圆(circle)形式
percentnumbertrue0进度百分比为0-100
colorstringfalse'#5584ff'进度区域显示的颜色
backColorstringfalse'#ebecf0'无进度区域显示的颜色
borderWidthnumberfalse6进度条边框宽度
radiusnumberfalse100在type为semicircle或circle形式下自定义圆的半径(包括边框的宽度),值要大于borderWidth。line形式想要控制宽度,直接在Progress外包裹一个自己期待的宽度的容器,Progress默认width为100%
textreactNodefalse''描述文本,整圆、半圆类型支持

示例

npm i react-css-progress

线状形式

<Progress type="line" percent={25} />

线状形式自定义颜色

<Progress type="line" percent={50} color="#52c41a" backColor="#eee" />

线状形式自定义边框宽度

<Progress type="line" percent={75} borderWidth={10} />

半圆形式

<Progress type="semicircle" percent={25} />

半圆形式自定义颜色

<Progress type="semicircle" percent={50} color="#52c41a" backColor="#eee" />

半圆形式自定义边框宽度

<Progress type="semicircle" percent={75} borderWidth={10} />

半圆形式自定义圆的半径

<Progress type="semicircle" percent={75} radius={60} />

半圆形式添加文案

<Progress type="semicircle" percent={75} radius={60} text={<div style={{ color: 'red' }}>text</div>} />

整圆形式

<Progress type="circle" percent={25} />

整圆形式自定义颜色

<Progress type="circle" percent={50} color="#52c41a" backColor="#eee" />

整圆形式自定义边框宽度

<Progress type="circle" percent={75} borderWidth={10} />

整圆形式自定义圆的半径

<Progress type="circle" percent={75} radius={60} />

整圆形式添加文案

<Progress type="circle" percent={75} text={<div style={{ color: 'red' }}>text</div>} />
0.1.6

2 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.5

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago