Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/andy9775/React-Native-CircularProgress
A pure React Native Component for circular progress bars
https://github.com/andy9775/React-Native-CircularProgress
javascript react react-native react-native-component reactjs
Last synced: 5 days ago
JSON representation
A pure React Native Component for circular progress bars
- Host: GitHub
- URL: https://github.com/andy9775/React-Native-CircularProgress
- Owner: andy9775
- License: mit
- Created: 2015-11-08T01:29:51.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2018-04-06T14:38:21.000Z (over 6 years ago)
- Last Synced: 2024-11-11T21:57:14.414Z (about 1 month ago)
- Topics: javascript, react, react-native, react-native-component, reactjs
- Language: JavaScript
- Homepage:
- Size: 10.3 MB
- Stars: 45
- Watchers: 4
- Forks: 9
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-react-native - react-native-progress-circular ★43 - A pure React Native Component for circular progress bars for both iOS and Android. (Components / UI)
- awesome-reactnative-ui - React-Native-CircularProgress - Native-CircularProgress/raw/master/demo.gif)| (Others)
- awesome-react-native - react-native-progress-circular ★43 - A pure React Native Component for circular progress bars for both iOS and Android. (Components / UI)
- awesome-reactnative-ui - React-Native-CircularProgress - Native-CircularProgress/raw/master/demo.gif)| (Others)
- awesome-react-native - react-native-progress-circular ★43 - A pure React Native Component for circular progress bars for both iOS and Android. (Components / UI)
- awesome-react-native-ui - react-native-progress-circular ★23 - A pure React Native Component for circular progress bars for both iOS and Android. (Components / UI)
- awesome-react-native - react-native-progress-circular ★43 - A pure React Native Component for circular progress bars for both iOS and Android. (Components / UI)
README
## React-Native-CircularProgress
A pure React Native Component for circular progress bars for iOS.## Demo
## Installation
1. Install library `npm i --save react-native-progress-circular`
2. Include in your project `var CircularProgressDisplay = require('react-native-progress-circular');`## Issues
As of react-native 0.17:
Due to react-native not yet supporting individual corner radius properties on android, support is lacking.## Basic Usage
```javascript
'use strict';
var React = require('react-native');
var CircularProgressDisplay = require('react-native-progress-circular');
var {View, Text} = React;module.exports = React.createClass({
getInitialState(){return { progress:0};
},
componentDidMount(){
// automatically increment the progress
var time = 150;
var count = 0;
setInterval(() => {
if (++count < 15){
return;
}
var progress = this.state.progress + Math.round((Math.random() * 4));
if (progress >100) {
progress = 0;
count = 0;
}
this.setState({progress: progress});
}, time);
},
render() {
var progress = this.state.progress;
// displayed inside of the component
var innerDisplay = (
{progress + "%"}
);return (
);}
});
```## Hollow Progress Bar Props
- **`size`** _(Number:ReactComponent)_ - The size of the component. The resulting components height and width
are equal
- **`progressBarWidth`** _(Integer)_ - The width of the circular progress bar.
- **`progressBarColor`** _(String)_ - The color of the progress bar.
- **`backgroundColor`** _(String)_ - The color of the center of the component and the zero progress area.
- **`outlineWidth`** _(Integer)_ - If this prop is present, the resulting component has a round border of this width.
- **`outlineColor`** _(String)_ - The color of the border outlining the component.
- **`rotate`** _(Integer)_ - The current progress to track specified in degrees. E.G. 270. Can take a value between 0
and 360, inclusive.
- **`innerComponent`** _(ReactComponent)_ - A component to display inside of the round hollow progress bar. Can be used
display an inner progress bar, or track the current progress with a `` component.## Filled Progress Bar Props
- **`size`** _(Number:ReactComponent)_ - The size of the component. The resulting components height and width
are equal
- **`rotate`** _(Integer)_ - The current progress to track specified in degrees. E.G. 270. Can take a value between 0
and 360, inclusive.
- **`backgroundColor`** _(String)_ - The color of the center of the component and the zero progress area. This is the color
of the component when no progress has been made.
- **`progressBarColor`** _(String)_ - The color of the progress bar. This is the color when progress has been made.---
**MIT Licensed**