Skip to content

Repository files navigation

licenseVersionnpmTwitter Follow

React Native Countdown Circle

React Native Countdown Circles

Features

  • Custom colors
  • Custom size and border radius
  • Light-weight: No other dependencies besides react-native
  • Performant and Smooth: Uses React Native's Animated library

Installation

yarn add react-native-countdown-circle

or

npm install --save react-native-countdown-circle

Usage

importCountdownCirclefrom'react-native-countdown-circle'render(){return(<CountdownCircleseconds={10}radius={30}borderWidth={8}color="#ff003f"bgColor="#fff"textStyle={{fontSize: 20}}onTimeElapsed={()=>console.log('Elapsed!')}/>)}

Props

NameDescriptionTypeRequiredDefault Value
secondsThe seconds to count down fromNumber
radiusThe radius in px of the component (including border)Number
borderWidthThe border width in pxNumber
colorThe border colorString#f00'#f00'
shadowColorThe background color of the borderString#999'#999'
bgColorThe inner background color of the componentString#e9e9ef'#e9e9ef'
containerStyleThe custom styling which will be applied to the container of the Text componentStylenull
textStyleThe custom styling which will be applied to the Text componentStylenull
updateTextA function used to display a different text inside this component. Is called after every second, with the number of elapsed seconds, and the total secondsfunc (elapsedSecs, totalSecs) => (totalSecs - elapsedSecs).toString()
onTimeElapsedA function being called when the countdown is overfunc () => null

Note: Setting the seconds prop to a different value restarts the timer with that new value.

Author

Christoph Michel

Implementation Details

React Native Progress Circle

License

MIT

About

A light-weight countdown circle indicator for React Native.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages