1.0.1 • Published 5 years ago

react-native-circle-timer v1.0.1

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

React-Native-Circle-Timer

The React Native Native iOS and Android Circle timer or countdown timer which renders the Circular countdown timer with user specific time and colors. This renders the timer with Hours & Minutes within it

See Example.js for example

Install

npm install --save react-native-circle-timer

How to use

This shows the default properties.

PropertyTypeDefaultRequiredDescription
radiusnumber40YESTo change the radius of timer
secondsnumber60YESSet the timer in seconds
borderWidthnumber10NOBorder witdth of the timer
showSecondboolfalseNORender Elapsed time when set to TRUE
borderColorstring#0E3657NOSet the border color of the timer
textStylestylenullNORender the elapsed time with user cutomization
stylestylenullNORender the timer with user cutomization
circleColorstring#FFFFFFNOChange the color of timer circle
borderBackgroundColorstring#A8C3BCNOColor of the left time in Timer
onTimeElapsedfuntionnullNOCalled when the timer is finished
import React, { View } from 'react-native';
import CircleTimer from 'react-native-circle-timer';

class ComponentClass extends React.Component {

    constructor(props) {
        super();
    }


    render() {
        return (
            <View
                style={{backgroundColor: "#06566e", justifyContent: 'center', alignItems: 'center', flex: 1}}>

                <CircleTimer
                        radius={80}
                        borderWidth={10}
                        seconds={1800}
                        borderColor={'#F5F5F5'}
                        borderBackgroundColor={"#FF0000"}
                        onTimeElapsed={() => {
                            console.log('Timer Finished!');
                        }}
                        showSecond={true}
                    />
            </View>
        )
    }
}