Coder Social home page Coder Social logo

jljlpch / react-native-progress Goto Github PK

View Code? Open in Web Editor NEW

This project forked from oblador/react-native-progress

0.0 2.0 0.0 184 KB

Progress indicators and spinners for React Native using ReactART

License: MIT License

JavaScript 76.82% Python 4.88% Java 4.00% Objective-C 14.30%

react-native-progress's Introduction

react-native-progress

Progress indicators and spinners for React Native using ReactART.

progress-demo

Installation

$ npm install react-native-progress --save

ReactART based components

To use the Pie or Circle components, you need to include the ART library in your project on iOS, for android it's already included.

For CocoaPod users:

Add the ART subspec like so:

pod 'React', path: '../node_modules/react-native', subspecs: [
  'ART',
]

Or manually:

Add the ART.xcodeproj (found in node_modules/react-native/Libraries/ART) to the Libraries group and add libART.a to Link Binary With Libraries under Build Phases. More info and screenshots about how to do this is available in the React Native documentation.

Usage

Note: If you don't want the ReactART based components and it's dependencies, do a deep require instead: import ProgressBar from 'react-native-progress/Bar';.

import * as Progress from 'react-native-progress';

<Progress.Bar progress={0.3} width={200} />
<Progress.Pie progress={0.4} size={50} />
<Progress.Circle size={30} indeterminate={true} />
<Progress.CircleSnail colors={['red', 'green', 'blue']} />

Properties for all progress components

Prop Description Default
animated Whether or not to animate changes to progress. true
indeterminate If set to true, the indicator will spin and progress prop will be ignored. false
progress Progress of whatever the indicator is indicating. A number between 0 and 1. 0
color Fill color of the indicator. rgba(0, 122, 255, 1)
unfilledColor Color of the remaining progress. None
borderWidth Width of outer border, set to 0 to remove. 1
borderColor Color of outer border. color

Progress.Bar

All of the props under Properties in addition to the following:

Prop Description Default
width Full width of the progress bar. 150
height Height of the progress bar. 6
borderRadius Rounding of corners, set to 0 to disable. 4

Progress.Circle

All of the props under Properties in addition to the following:

Prop Description Default
size Diameter of the circle. 40
thickness Thickness of the inner circle. 3
showsText Whether or not to show a text representation of current progress. false
formatText(progress) A function returning a string to be displayed for the textual representation. See source
textStyle Styles for progress text, defaults to a same color as circle and fontSize proportional to size prop. None
direction Direction of the circle clockwise or counter-clockwise clockwise

Progress.Pie

All of the props under Properties in addition to the following:

Prop Description Default
size Diameter of the pie. 40

Progress.CircleSnail

Prop Description Default
animating If the circle should animate. true
hidesWhenStopped If the circle should be removed when not animating. true
size Diameter of the circle. 40
color Color of the circle, use an array of colors for rainbow effect. rgba(0, 122, 255, 1)
thickness Thickness of the circle. 3
duration Duration of animation. 1000
spinDuration Duration of spin (orbit) animation. 5000

Examples

Thanks

To Mandarin Drummond for giving me the NPM name.

License

MIT License. © Joel Arvidsson 2015

react-native-progress's People

Contributors

oblador avatar giladartzi avatar adba avatar jrichardlai avatar jastanton avatar

Watchers

 avatar  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.