1.0.3 • Published 5 years ago

timer-component v1.0.3

Weekly downloads
4
License
MIT
Repository
github
Last release
5 years ago

React Timer Component

A React Timer component based on a jquery based component. Displays a timer on creation and updates every second.

Check out the live Demo.

npm.io

Installation

Install through npm or yarn.

npm install timer-component
yarn add timer-component

Usage

import Timer from 'timer-component';

Props

seconds (required)

Use seconds to declare how many seconds the timer should count for. Accepts any positive integer.

<Timer seconds={60}/>

className (optional)

Use className to add a CSS class onto the component.

<Timer className={"custom-class-name"}/>

Pitfalls

This component does not support time intervals larger than hours or smaller than seconds (i.e. days or milliseconds).

Development

There are some scripts available in package.json.

  • yarn start - to watch for file changes and update automatically with webpack
  • yarn build - to build the package and store in ./dist/index.js

I welcome any from of participation, so feel free to submit an issue or make a pull request.

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago