Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rc-stopwatch

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rc-stopwatch

Simple stopwatch in React.js

  • 0.0.5
  • unpublished
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

REACT STOPWATCH

React.js implementation of stop watch.

npm version npm downloads npm license


Props
PropTypeOptionalDefaultDescription
timeTextStyleObjectYes{}Time style object to style stop watch time.
buttonStyleObjectYes{}Button Style object to apply common style to all buttons
startButtonStyleObjectYes{}Start Button Style react object
pauseButtonStyleObjectYes{}Pause Button Style react object
resetButtonStyleObjectYes{}Reset Button Style react object
containerStyleObjectYes{}Container Style react object
buttonContainerStyleObjectYes{}Button Container Style react object
buttonClassStringYes""Common CSS class name
startButtonClassStringYes""Start Button CSS class name
pauseButtonClassStringYes""Pause Button CSS class name
resetButtonClassStringYes""Reset Button CSS class name
containerClassStringYes""Chronometer Container CSS class name
buttonContainerClassStringYes""Button Container CSS class name
timeTextClassStringYes""Time Text CSS class
startButtonTextStringYes""Start button text
pauseButtonTextStringYes""Pause Button text
resetButtonTextStringYes""Reset Button text
onTimeChangefunctionYes() => {}Callback function to get time object { seconds, minutes, hours }
Usage
import React from "react";
import "./App.css";

import Stopwatch from 'rc-stopwatch';

const styles = {
  container: {
    width: "300px"
  },
  startBtn: {
    backgroundColor: "#daaeee",
    color: "#333"
  },
  btn: {
    fontFamily: "monospace"
  },
  title: {
    textAlign: "center",
    color: "#add"
  },
  timeText: {
    fontSize: "19pt",
    fontWeight: "bold"
  },
  btnWrapper: {
    flexDirection: "column"
  },
};

const App = () => (
  <div>
    <h1 style={styles.title}>React Stopwatch Demo</h1>
    <Stopwatch
      buttonClass="button"
      timeTextStyle={styles.timeText}
      buttonContainerStyle={styles.btnWrapper}
      onTimeChange={obj => console.log(obj)}
    />
  </div>
);

export default App;
Things yet to be done
  • Implement timer

Keywords

FAQs

Package last updated on 09 May 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc