All Projects → bartgryszko → React Native Circular Progress

bartgryszko / React Native Circular Progress

Licence: mit
React Native component for creating animated, circular progress with ReactART

Programming Languages

javascript
184084 projects - #8 most used programming language
typescript
32286 projects

Projects that are alternatives of or similar to React Native Circular Progress

Vue Ellipse Progress
A Vue.js component to create beautiful animated circular progress bars
Stars: ✭ 101 (-94.69%)
Mutual labels:  progress, circle
mp-progress
专注于小程序圆环形进度条的小工具
Stars: ✭ 72 (-96.21%)
Mutual labels:  progress, circle
Hgcircularslider
A custom reusable circular / progress slider control for iOS application.
Stars: ✭ 2,240 (+17.83%)
Mutual labels:  progress, circle
Rpcircularprogress
(Swift) Circular progress UIView subclass with UIProgressView properties
Stars: ✭ 236 (-87.59%)
Mutual labels:  progress, circle
Progress
基于Vue 2.x 的进度条,支持直线和环形(顺时针和逆时针)。Vue-based progress component, support line and circle(clockwise or couterclockwise).
Stars: ✭ 130 (-93.16%)
Mutual labels:  progress, circle
Ring
圆环进度条,环形进度条
Stars: ✭ 52 (-97.26%)
Mutual labels:  progress, circle
tox-progress
This JavaScript library was made to easily create animated radial progress bars.
Stars: ✭ 13 (-99.32%)
Mutual labels:  progress, circle
Xlcircleprogress
iOS 圆环进度指示器
Stars: ✭ 93 (-95.11%)
Mutual labels:  progress, circle
React Circle
Renders a svg circle + progress, it just works 💘
Stars: ✭ 925 (-51.34%)
Mutual labels:  progress, circle
Circleprogressview
🎡 CircleProgressView是一个圆形渐变的进度动画控件(支持外环显示刻度,内环随之变化,配置参数完全可配),动画效果纵享丝滑。
Stars: ✭ 314 (-83.48%)
Mutual labels:  progress, circle
Mkringprogressview
⭕️ Ring progress view similar to Activity app on Apple Watch
Stars: ✭ 1,140 (-40.03%)
Mutual labels:  progress, circle
Jocircularslider
A highly customisable and reusable circular slider for iOS applications.
Stars: ✭ 128 (-93.27%)
Mutual labels:  progress, circle
Arcseekbar
🎡 ArcSeekBar 一个弧形可拖动进度条控件。弧形大小,弧度,颜色渐变等配置完全可定制化
Stars: ✭ 115 (-93.95%)
Mutual labels:  circle
Vue Loaders
Vue + loaders.css
Stars: ✭ 127 (-93.32%)
Mutual labels:  progress
Ruby Progressbar
Ruby/ProgressBar is a text progress bar library for Ruby.
Stars: ✭ 1,378 (-27.51%)
Mutual labels:  progress
Swift project
原OC项目用swift实现,纯swift项目,可作为学习swift的demo,包含多个自定义控件,并且进行封装网络请求库,结构清晰。
Stars: ✭ 133 (-93%)
Mutual labels:  progress
Tileprogressview
Simple Progress View with Tile Animation
Stars: ✭ 126 (-93.37%)
Mutual labels:  progress
Lcprogresshud
一个超简单的活动指示器。适配横屏。
Stars: ✭ 100 (-94.74%)
Mutual labels:  progress
Terminal layout
The project help you to quickly build layouts in terminal,cross-platform(一个跨平台的命令行ui布局工具)
Stars: ✭ 98 (-94.84%)
Mutual labels:  progress
Delayedprogress
ProgressDialog that waits a minimum time to be dismissed before showing. Once visible, the ProgressDialog will be visible for a minimum amount of time to avoid "flashes" in the UI.
Stars: ✭ 95 (-95%)
Mutual labels:  progress

react-native-circular-progress

license Version npm

React Native component for creating animated, circular progress. Useful for displaying users points for example.

Example app

image

Installation

  1. Install this component and react-native-svg:

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

  2. Link native code for SVG:

    react-native link react-native-svg

Usage

import { AnimatedCircularProgress } from 'react-native-circular-progress';

<AnimatedCircularProgress
  size={120}
  width={15}
  fill={100}
  tintColor="#00e0ff"
  onAnimationComplete={() => console.log('onAnimationComplete')}
  backgroundColor="#3d5875" />

You can also define a function that'll receive current progress and for example display it inside the circle:

<AnimatedCircularProgress
  size={200}
  width={3}
  fill={this.state.fill}
  tintColor="#00e0ff"
  backgroundColor="#3d5875">
  {
    (fill) => (
      <Text>
        { this.state.fill }
      </Text>
    )
  }
</AnimatedCircularProgress>

You can also define a function that'll receive the location at the top of the progress circle and render a custom SVG element:

<AnimatedCircularProgress
  size={120}
  width={15}
  fill={100}
  tintColor="#00e0ff"
  backgroundColor="#3d5875"
  padding={10}
  renderCap={({ center }) => <Circle cx={center.x} cy={center.y} r="10" fill="blue" />}
  />

Finally, you can manually trigger a duration-based timing animation by putting a ref on the component and calling the animate(toValue, duration, easing) function like so:

<AnimatedCircularProgress
  ref={(ref) => this.circularProgress = ref}
  ...
/>
this.circularProgress.animate(100, 8000, Easing.quad); // Will fill the progress bar linearly in 8 seconds

The animate-function returns the timing animation so you can chain, run in parallel etc.

Configuration

You can configure the CircularProgress-component by passing the following props:

Name Type Default value Description
size number|Animated.Value required Width and height of circle
width number required Thickness of the progress line
backgroundWidth number width Thickness of background circle
fill number (0-100) 0 Current progress / fill
tintColor string black Color of the progress line
tintTransparency boolean true Transparency of the progress line
backgroundColor string If unspecified, no background line will be rendered
rotation number (-360 - 360) 90 Angle from which the progress starts from
lineCap string butt Shape used at ends of progress line. Possible values: butt, round, square
arcSweepAngle number (0-360) 360 If you don't want a full circle, specify the arc angle
style ViewPropTypes.style Extra styling for the main container
children function Pass a function as a child. It received the current fill-value as an argument
childrenContainerStyle ViewPropTypes.style Extra styling for the children container
padding number 0 Padding applied around the circle to allow for a cap that bleeds outside its boundary
dashedBackground object { width: 0, gap: 0 } Bar background as dashed type
dashedTint object { width: 0, gap: 0 } Bar tint as dashed type
renderCap function undefined Function that's invoked during rendering to draw at the tip of the progress circle

The following props can further be used on AnimatedCircularProgress:

Name Type Default value Description
prefill number (0-100) 0 Initial fill-value before animation starts
duration number 500 Duration of animation in ms
easing function Easing.out(Easing.ease) Animation easing function
onAnimationComplete function Function that's invoked when the animation completes (both on mount and if called with .animate())
onFillChange function Function that returns current progress on every change
tintColorSecondary string the same as tintColor To change fill color from tintColor to tintColorSecondary as animation progresses

AnimatedCircularProgress also exposes the following functions:

Name Arguments Description
animate (toVal: number, duration: number, ease: function) Animate the progress bar to a specific value
reAnimate (prefill: number, toVal: number, duration: number, ease: function) Re-run animation with a specified prefill-value

Running example app (Expo)

git clone https://github.com/bgryszko/react-native-circular-progress.git
cd react-native-circular-progress/example-app
yarn
yarn start

Authors

  • Bartosz Gryszko ([email protected])
  • Markus Lindqvist
  • Jacob Lauritzen
  • Special thanks to all contributors!

License

MIT

Special thanks

Special thanks to Chalk+Chisel for creating working environment where people grow. This component was created for one of the projects we're working on.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].