0.1.2 • Published 1 year ago

@sujitsimon/react-flipclock v0.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

MIT License

react-flip-clock

A simple react-flip-clock widget with customizaion

Download Project

Clone react-clock

  git clone https://github.com/sujitsimon/react-flip-clock.git

Installation

Install react-flip-clock with npm

  npm i @sujitsimon/react-flipclock

Usage/Examples

import { Clock } from '@sujitsimon/react-flipclock';

function App() {
  return <Clock config={{height: '100px', backgroundColor: '#241623', textColor: '#fff'}}/>
}

Demo

npm.io

API Reference

Clock API

  <Clock config={{height: '100px', backgroundColor: '#241623', textColor: '#fff'}}/>
ParameterTypeDescription
heightstringheight of clock element. Default: 100px
backgroundColorstringbackground hex color code. Default: #241623
textColorstringtext hex color code. Default: #FFFFFF
formatstring12h or 24h Default: 12h

Countdown Timer API

  <CountDownTimer config={{height: '100px', backgroundColor: '#241623', textColor: '#fff'}}
                  countDownTime={{hours: 0, minutes: 0, seconds: 10}}
                  onCountDownComplete={()=> {console.log('Timer Complete')}}/>
ParameterTypeDescription
heightstringheight of clock element. Default: 100px
backgroundColorstringbackground hex color code. Default: #241623
textColorstringtext hex color code. Default: #FFFFFF
countDownTimeobjectMandatory:{hours: number, minutes: number, seconds: number}
onCountDownCompletecallbackCallback function on Countdown timer Complete

StopWatch API

  <StopWatch config={{height: '100px', backgroundColor: '#241623', textColor: '#fff'}} onTimerExit={(s)=> {console.log('Timer Exit', s)}}/>
ParameterTypeDescription
heightstringheight of clock element. Default: 100px
backgroundColorstringbackground hex color code. Default: #241623
textColorstringtext hex color code. Default: #FFFFFF
stopTimerbooleanstop timer
onTimerExitcallbackCallback function on stopTimer is called. Returns elapsed_time in ms