JSPM

@akash3gupta/react-count-down-timer

2.0.3
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 5
    • Score
      100M100P100Q36253F
    • License MIT

    Countdown timer is a common UI component. It is just a simple stop watch kind of UI clock.

    Package Exports

    • @akash3gupta/react-count-down-timer

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@akash3gupta/react-count-down-timer) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    react-count-down-timer

    Countdown timer is a common UI component and it is just a simple stop watch kind of UI clock.

    NPM JavaScript Style Guide

    Install

    npm install @akash3gupta/react-count-down-timer

    Usage

    import React from 'react'
    
    import { ReactCountDownTimer } from '@akash3gupta/react-count-down-timer'
    
    const App = () => {
    
      const durationOfTimer = 20; // in minutes
    
      const handleTimerTick = () => {
        console.log('Trigger after every 1 mins');
      }
    
      const handleTimerCompleted = () => {
        console.log('Trigger after time completed');
      }
    
      const customStyles = {
        color: 'red',
        fontSize: '20px'
      }
    
      return <ReactCountDownTimer
              id={'your id'}  // this is optional prop just to give unique id to element
              classes={'your class'}  // this is optional prop just to give your custom classes
              styles={customStyles}  // this is optional prop just to give your custom styles
              duration={durationOfTimer}
              onTimerTick={handleTimerTick}
              onTimerCompleted={handleTimerCompleted}
            />
    }
    
    export default App

    Demo

    License

    MIT ©