1.1.0 • Published 2 years ago

react-spinner-timer v1.1.0

Weekly downloads
73
License
MIT
Repository
github
Last release
2 years ago

NPM COVERAGE

React-Spinner-Timer

The React Spinner Timer for React.

Circular countdown timer with progressive animation.

Component

React Spinner Timer

Installation and usage

To install React Spinner Timer you can run:

yarn add react-spinner-timer

or

npm install react-spinner-timer

To use:

import React from "react";
import ReactSpinnerTimer from "react-spinner-timer";

function App() {
  const handleChange = (lap) => {
    if (lap.isFinish)
      console.log("Finished!!");
    else
      console.log("Running!! Lap:", lap.actualLap);
  };
  return (
    <ReactSpinnerTimer
      timeInSeconds={60}
      totalLaps={60}
      isRefresh={false}
      onLapInteraction={handleChange}
      isPause={false}
    />
  );
}
export default App;

See another example at Code Sandbox

Props

Common props you need to specify:

PropTypeDescription
timeInSecondsNumberComponent lap time
totalLapsNumberNumber of laps
onLapInteractionFunctionWhen you complete a lap, what to do?
isRefreshBooleanRefresh the lap (Optional)
isPauseBooleanDefault (true) pause time count

Function callback of OnLapInteraction

PropTypeDescription
actualLapNumberLap actual
totalLapsNumberNumber of total laps
isFinishBooleanInteractions is finished
timeInSecondsNumberTime of lap

Thanks

Thanks for downloading, use wisely!

1.1.0

2 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago