1.0.1 • Published 5 years ago

react-native-dashed-progress v1.0.1

Weekly downloads
13
License
MIT
Repository
github
Last release
5 years ago

react-native-dashed-progress

license Version npm

React Native component to draw circular dashed progress bar.

Example

image

Installation

  1. Install react-native-dashed-progresscomponent and react-native-svg:

    npm i --save react-native-dashed-progress react-native-svg

    skip step 2 if you are using react-native >= 0.60

  2. Link native code for SVG:

    react-native link react-native-svg

Usage

import {DashedProgress} from 'react-native-dashed-progress';

<DashedProgress
  fill={20} 
  countBars={50} 
  radius={50}
  strokeColor="#00e0ff"/>

Props

PropsTypeDefaultDescription
radiusNumber100Radius of circle
barWidthNumber10Length of dash
indicatorWidthNumber20Length of indicator
countBarsNumber100Total number of dashes in circle
strokeThicknessNumber1Thickness of dash
fillNumber (>=0 and <=countBars)50Total number of filled Dashes in circle
textString50%A Text will display in the circle
strokeLinecapStringroundShape used at ends of dash. Possible values: butt,round, square
trailColorString#000000Color of unfilled dashes
strokeColorString#008000Color of filled dashes
showTooltipBooleantrueEnabled to display Text inside the circle
tooltipSizeNumber12fontSize of text
tooltipColorString#008000fontColor of text
tooltipFamilyStringfontFamily of text
divideEnabledBooleanfalseEnabled to divide countBars into given dividerNumber
dividerNumberNumber10Number which will divide by countBars
dividerNumberSizeNumber9fontSize of dividerNumber
showIndicatorBooleantrueEnabled to display stop indicator in animated Circle
indicatorColorString#008000Color of indicator
durationNumber1000Total time to animate dashes
containerStyleObjectExtra styling for the main container

Running example app

git clone https://github.com/websoptimization/react-native-dashed-progress.git
cd react-native-dashed-progress/example
npm install
react-native-run-android OR react-native-run-ios

License

MIT