1.1.0 • Published 4 years ago

progress-react-native v1.1.0

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

Progress indicator using reanimated and react native svg


Table of Contents

  1. Installation
  2. Usage
  3. Props
  4. Credits
  5. License

Installation

yarn add progress-react-native
# or
npm install progress-react-native

Also, you need to install react-native-reanimated, & react-native-svg, and follow theirs installation instructions.

Usage

import * as React from 'react';
import { StyleSheet, View, Text } from 'react-native';
import ProgressReactNative from 'progress-react-native';

export default function App() {
  return (
    <View style={styles.container}>
      <ProgressReactNative preset={'bar'} indeterminate={false} progress={40} duration={2000} />
      <ProgressReactNative preset={'pie'} indeterminate={false} progress={40} duration={2000} />
      <ProgressReactNative preset={'cicle'} showText={true} textConcat={'%'} indeterminate={false} progress={40} duration={2000} />
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    alignItems: 'center',
    justifyContent: 'center',
  },
});

Props

namerequireddefaultdescription
presetNO"bar"Preset for progress.
progressNO0Current progress.
animatedNOtrueFlag to use animated when progress change or not.
durationNO1000Duration of animated.
indeterminateNOfalseIf set to true, the indicator will spin.
namerequireddefaultdescription
heightNO6Height of the progress bar.
colorNO#0057e7Color of indicator.
borderRadiusNO4Rounding of corners, set to 0 to disable.
borderColorNO#0057e7Color of outer border.
borderWithNO1Width of outer border, set to 0 to remove.
namerequireddefaultdescription
radiusNO40Radius of circle.
strokeWidthNO4Width of stroke.
strokeColorNO#0057e7Stroke color .
bgStrokeColorNOtransparentBackground stroke color .
isRadiusNOfalseUsing radius for progress line.
showTextNOfalseShow current progress or not.
textConcatNO''Text assigned after the progress.
textStyleNO''Text style for progress.
namerequireddefaultdescription
radiusNO40Radius of Pie.
strokeWidthNO1Width of stroke.
strokeColorNO#0057e7Stroke color.
fillColorNO#0057e7Color of progress.
bgColorNOtransparentBackground color stroke.

Built With

License

MIT