timer-component

1.0.3 • Public • Published

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.

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.

Readme

Keywords

Package Sidebar

Install

npm i timer-component

Weekly Downloads

8

Version

1.0.3

License

MIT

Unpacked Size

76 kB

Total Files

8

Last publish

Collaborators

  • alvinnguyen116