Git Product home page Git Product logo

react-circle-progress's Introduction

sanyuelanv-circle-progress

安装

  npm install --save sanyuelanv-circle

使用

  import Circle from 'sanyuelanv-circle'
  <Circle
    current = {this.state.current}
    startPoint = {0}
    gradientDirection = {"horizontal"}
    gradient = {
      [
        {offset:0,color:"rgb(255,255,0)",opacity:1},
        {offset:50,color:"rgb(255,0,0)",opacity:1},
      ]
    }
  />

参见例子:demo文件夹

参数

所有参数使用props传递。

参数名字 说明 默认值
size int 整个svg的宽高,因为是圆形所以只要一个值 200
strokeWidth int 进度条的宽度 10
radius int 进度条所在圆形的半径 95
progressColor string 进度条激活的颜色 "#249fff"
bottomColor string 进度条未激活的颜色 "#cccccc"
progressFillColor string 进度条所在圆形激活的颜色 "transparent"
bottomFillColor string 进度条所在圆形未激活的颜色 "transparent"
time number 进度条发生变化动画用时 0.5
startPoint number 进度条起始位置 0
gradientDirection string 进度条渐变方向[vertical,horizontal] vertical
gradient object 进度条渐变配置 null
current number 进度条当前进度(范围0-1)
showText Boolean 是否显示文字
textStyle object 文字样式(目前只能上下左右居中),type参数是文字显示形式。0:带百分比符号的整型数,1:不带百分比的两位小数,2:不带百分比的整型数 {size:12,color:"#555",type:0}
linecap string 进度条两端的样式(round/square) "square"

启动例子

  npm install
  npm run demo

react-circle-progress's People

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.