1.0.1 • Published 10 months ago

@mozart25/react-timer v1.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
10 months ago

@mozart25/react-timer

A customizable React timer component.

Installation

You can install this package via npm:

npm install @mozart25/react-timer

Usage

import React from "react";
import Stopwatch from "@mozart25/react-timer";

const CustomStopwatch = () => {
  return (
    <Stopwatch
      renderContainer={(children) => (
        <div style={{ border: "2px solid black", padding: "20px" }}>
          {children}
        </div>
      )}
      renderDisplay={(formattedTime) => <h1>{formattedTime}</h1>}
      renderControls={({ start, stop, reset }) => (
        <div>
          <button onClick={start}>Start</button>
          <button onClick={stop}>Stop</button>
          <button onClick={reset}>Reset</button>
        </div>
      )}
    />
  );
};

License

MIT

1.0.1

10 months ago

1.0.0

10 months ago