react-tick
v0.1.3
Published
Countdown timer for React
Downloads
3
Maintainers
Readme
react-tick
Countdown timer for React
Installation
npm install react-tick
Usage
var React = require('react');
var Tick = require('react-tick');
var ReactDOM = require('react-dom');
ReactDOM.render(
<Tick
format="remain: {dd} days {hh} hours {mm} minutes {ss} seconds"
endTime="2015/12/31 23:59:59"
onTimeUp={onTimeUp} />,
mountNode
);
Manifest
format
A string used to format the display string with some variables. HTML tags is supported.
- dd remain days.
- hh remain hours.
- mm remain minutes.
- ss remain seconds.
endTime
A string to indicate end time, the time format should be yyyy/MM/dd hh:mm:ss
like 2012/12/31 23:59:59
.
onTimeUp
A function will be executed when time is up.
License
MIT, see the LICENSE file for detail.