A customizable countdown component for React Native.
npm install --save react-native-timer-countdown`or
yarn add react-native-timer-countdownimport TimerCountdown from 'react-native-timer-countdown'
render() {
return (
<TimerCountdown
initialSecondsRemaining={360}
onTick={() => console.log('tick')}
onTimeElapsed={() => console.log('complete')}
allowFontScaling={true}
style={{ fontSize: 20 }}
/>
)
}| Name | Description | Type | Required | Default Value |
|---|---|---|---|---|
| initialSecondsRemaining | The time remaining for the countdown (in ms) | number | ✓ | |
| interval | The time between timer ticks (in ms). | number | ✓ | 1000ms |
| allowFontScaling | to allow font scaling | bool | false | |
| style | The custom styling which will be applied to the Text component | style | ||
| formatFunc | A function that formats the secondsRemaining | func | ||
| onTick | A function to call each tick | func | ||
| onTimeElapsed | A function to call when the countdown completes | func |
Avid21
MIT