2.1.0 • Published 8 years ago

react.timer v2.1.0

Weekly downloads
57
License
MIT
Repository
github
Last release
8 years ago

react.timer

A super simple timer component made in ReactJS

What is react.timer?

This is a very simple timer component that can count up or down. It only returns a span with the counting digits. On countUp it starts on 00:00 and counts with increments of one second. On countDown it starts on a startTime in seconds gotten from props and counts down to zero. The last 10 seconds the color is red and showing tens.

Example of countUp

import React from 'react'
import Timer from 'react.timer'
function () {
  return <Timer />
}
/* 00:00 -> 00:01 -> ... -> 12:31 (mm:ss) */

Example of countDown

import React from 'react'
import Timer from 'react.timer'
function () {
  return <Timer countDown startTime={30} />
}
/* 30 -> 29 -> ... -> <red> 9.9 -> 9.8 -> ... -> 0.0 </red> */

Install

npm i react.timer

To run the example

  • Clone the repo
  • npm i
  • npm start

To run the 27 tests

  • clone the repo
  • npm i
  • npm test

js-standard-style

2.1.0

8 years ago

2.0.0

8 years ago

1.8.0

8 years ago

1.7.0

8 years ago

1.6.0

8 years ago

1.5.0

8 years ago

1.4.0

8 years ago

1.3.0

8 years ago

1.2.5

8 years ago

1.2.3

8 years ago

1.2.2

8 years ago

1.2.1

8 years ago

1.2.0

8 years ago

1.1.0

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago