1.0.0 • Published 3 years ago

react-native-time-counter v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

react-native-time-counter

Install

$ npm install react-native-time-counter --save or $ yarn add react-native-time-counter --save

Import

import TimeCounter from 'react-native-time-counter';

Props

NameDescriptionTypeDefault Value
stateCounter type "forward" or "countdown"stringforward
countdownSecondsCountdown start secondsnumber120
maxSecondsCounter end secondsnumbernull
onCountdownEndTodo when countdown endfunctionnull
onMaxSecondsTodo when counter equal to max secondsnull
hideHourTo hide hour textbooleantrue
styleContainer styleobject
fontStyleText styleobject

Forward Usage

<TimeCounter state={"forward"}
             hideHour={false}
             onMaxSeconds={() => console.log('Test')}
             maxSeconds={10}/>

Countdown Usage

<TimeCounter state={"countdown"}
             hideHour={false}
             onCountdownEnd={()=>console.log('Test')}
             countdownSeconds={10}/>