A digital clock for React apps
bash
npm install my-awesome-react-digital-clock
`
Make sure you have React (v19+) installed, as defined in the peer dependencies.
Usage
$3
` jsx Copy
import React from 'react';
import { DigitalClock } from 'my-awesome-react-digital-clock';
function MyDigitalClock() {
return (
<>
{/ Default /}
bgColor={'#424242'}
fgColor={'#fff'}
hoverColor={'rgba(66,66,66,0.66)'}
size={300}
format={'12h'}
timezone={'Europe/Berlin'}
/>
bgColor={'#f4f4f4'}
fgColor={'#248cff'}
hoverColor={'rgba(186,231,255,0.55)'}
size={500}
format={'24h'}
timezone={'UTC'}
/>
bgColor={'#f4f4f4'}
fgColor={'rgba(255,36,36,0.91)'}
hoverColor={'rgba(255,36,36,0.34)'}
size={650}
format={'24h'}
timezone={'Europe/London'}
/>
<>
);
}
export default MyDigitalClock;
`
Props
$3
| Prop | Type | Default | Description |
|----------------|-------------------|-----------------------|-------------------|
| size | Number | 250 | size in px |
| bgColor | String | #424242 | Background color | | | light | Digital clock. |
| fgColor | String | #fff | Foreground color | | light | Digital clock. |
| hoverColor | String | rgba(66,66,66,0.66) | Hover color | | light | Digital clock. |
| format | '24h' or '12h' | '24h' | Display time format |
| timeZone | String | current timezone | Timezone | | light` | Digital clock. |