1.0.5 • Published 7 years ago

react-prog-bar v1.0.5

Weekly downloads
6
License
MIT
Repository
github
Last release
7 years ago

react-progress-bar

Simple github style progress bar for React.
npm.io
npm.io
npm.io

1. Installation

npm install --save react-prog-bar

2. Demo & Examples

To build the examples locally, run:

npm install
npm start

3. Usage

react-progress-bar can be used for ajax or fetch. Pseudo code below:

let isFetching = false;
const loadData = () => {
  isFetching = true;
  fetch(url).then(response => {
      isFetching = false;
  });
}

import ReactProgress from 'react-prog-bar';
<ReactCodeMirror trigger={isFetching}/>,

4. Properties

proptypedefaultnotes
triggerbool or numberfalseShow the bar or set percent of the width, when trigger is number, its value should be 0-100
heightstring2pxHeight of bar
topboolfalseSet the bar attach to top or not
colorstring#77b6ffColor of bar
starColorstringwhiteThe point at beginning of bar.
waitTimenumber10When trigger is true, the bar will take this time to 80% width and wait until trigger switch to false
finishTimenumber1When trigger switch from true to false, the bar will take this time to 100% width
stepTimenumber0.4When trigger is number and the value is changed, the bar's width change from value1(%) to value2(%) during stepTime
disappearTimenumber0.4When the bar's width is 100%, it will be invisible in disappearTime

License

Copyright (c) 2017 ZiQiangWang MIT Licensed.