1.0.2 • Published 6 years ago

tombeo-react-countdown v1.0.2

Weekly downloads
22
License
-
Repository
github
Last release
6 years ago

tombeo-react-countdown

React component to render countdown timer including number of days toward a specified time in future.

Install

npm install tombeo-react-countdown

Usage

import {TombeoReactCountdown} from 'tombeo-react-countdown'

renderCountdown = () => {
	return (
		<div>
			<TombeoReactCountdown 
				completeAt={Date.now() + 14*24*60*60*1000} 
				dayLabel='Day' 
				dayLabelPlural='Days' />
		</div>
	);
}

This will render a dynamic countdown text like below:

13 days + 23:59:59

And it will countdown & update every seconds.

Props

Required props are marked with *.

NameTypeDefaultDescription
completeAt*numericDate.now() + 10000Unix Time when you want countdown complete in miliseconds.
dayLabelstringDayLabel of word 'Day' depend on your country language.
dayLabelPluralstringDaysLabel of word 'Day' in plural depend on your country language.
onCompletefunctionnullFunction to execute when countdown complete.
completedTextstringCountdown completed!The text displayed when countdown completed. You can use empty string.
1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago