React component timer and stopwatch
npm install react-stopwatch-timernpm install --save react-stopwatch-timer yarn add react-stopwatch-timerimport ReactStopwatchTimer from 'react-stopwatch-timer'; true or false(default) true make stopwatch or timer will start stopwatch or timer default variable is unset. In this props you can choose to your watch work like stopwatch or timer Date object, default is present time. More about Date. This props set time for stopwatch or timer will start it true or false(default) decide about display beautiful circle around timer or stopwatch true(default) or false If you don't need hours in your watch you can set this props for false true(default) or false If you don't need minutes in your watch you can set this props for false true(default) or false If you don't need seconds in your watch you can set this props for false js
import React from 'react';
import ReactTimerStopwatch from 'react-stopwatch-timer';const App = () => {
return (
);
};
export default App;
`
#### Watch with circle
!example
`js
import React from 'react';
import ReactTimerStopwatch from 'react-stopwatch-timer';const App = () => {
return (
);
};
export default App;
`
#### Stopwatch
!example
`js
import React from 'react';
import ReactTimerStopwatch from 'react-stopwatch-timer';const fromTime = new Date(0, 0, 0, 0, 0, 0, 0);
const App = () => {
return (
displayCricle={true} color="gray" hintColor="red" fromTime={fromTime}/>
);
};
export default App;
`
#### Timer
!example
`js
import React from 'react';
import ReactTimerStopwatch from 'react-stopwatch-timer';const fromTime = new Date(0, 0, 0, 0, 10, 0, 0);
const App = () => {
return (
displayCricle={true} color="gray" hintColor="red" fromTime={fromTime}/>
);
};
export default App;
`
#### Without Hours
!example
`js
import React from 'react';
import ReactTimerStopwatch from 'react-stopwatch-timer';const fromTime = new Date(0, 0, 0, 0, 10, 0, 0);
const App = () => {
return (
displayCricle={true} color="gray" hintColor="red" fromTime={fromTime} displayHours={false}/>
);
};
export default App;
`
#### With button inside circle
!example
`js
import React, {useState} from 'react';
import ReactTimerStopwatch from 'react-stopwatch-timer';const fromTime = new Date(0, 0, 0, 0, 10, 0, 0);
const App = () => {
const [isOn, setIsOn] = useState(false);
return (
displayCricle={true} color="gray" hintColor="red" fromTime={fromTime} displayHours={false}>
);
};
export default App;
`
#### Custom style circle element
!example
in js file:
import './App.css'
in css or scss file:
`css
.react-stopwatch-timer__element {
width: 3px !important;
height: 3px !important;
border-radius: 5px;
}.react-stopwatch-timer__table{
width: 300px !important;
height: 300px !important;
}
``