2.0.0 • Published 3 years ago

react-native-multicolor-progress-bar v2.0.0

Weekly downloads
58
License
ISC
Repository
github
Last release
3 years ago

react-native-multicolor-progress-bar

v2 supports latest version of react. v1 has the older version of react.

Progress indicators

example

SC Image

Installation

npm install react-native-multicolor-progress-bar --save

Usage

import {ProgressBar} from 'react-native-multicolor-progress-bar';

<ProgressBar
  arrayOfProgressObjects={[
   {
     color: 'red',
     value: 0.4,
     nameToDisplay: "40%"
   },
   {
     color: 'blue',
     value: 0.6,
     opacity: 0.5
   },
  ]}
/>

Properties for progress component

PropDataTypeDescriptionDefault
parentViewStylestylesChange the styling of the container view{alignItems:'stretch'}
backgroundBarStylestylesChange the styling of base progress bar{alignItems:'stretch',backgroundColor: '#EFF1F5',borderRadius: 8.5,height: 12}
onStartProgressStylestylesChange the border radius of starting progress bar{borderTopLeftRadius: 8.5,borderBottomLeftRadius: 8.5}
onEndProgressStylestylesChange the border radius of ending progress bar if it reaches the end of base progress bar{borderTopRightRadius: 8.5,borderBottomRightRadius: 8.5}
arrayOfProgressObjectsarray of ObjectsContains the progress objects.[]
onPressfunctionif provided, this function will be called if the user taps on the progress barundefined
textStylestylesstyling of the text displayed in each coloured progress bar{fontSize:10}

Progress Object

KeyDataTypeValue
colorstringcolor of the progress object
opacitynumberopacity of the progress object
nameToDisplaystringif exists, displays this on the progress
valuenumber ranging from 0 - 1value of the progress

Example project bundled with this module