1.0.1 • Published 4 years ago
@berserk-code/react-clock v1.0.1
@berserk-code/react-clock
Made with create-react-library
Install
npm install --save @berserk-code/react-clock
Usage
import React from 'react'
import Clock from '@berserk-code/react-clock'
const App = () => {
const color = '#59df7a';
const dateColor = '#09b8be';
return <Clock
gradient
color={color}
dateColor={dateColor}
locales={['es-ES']}
optionsLocaleDate={{ weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' }}
optionLocaleTime={{ hour12: true, hour: '2-digit', minute: '2-digit', second: '2-digit' }}
/>
}
export default App
Properties
Property | Type | Default | Description |
---|---|---|---|
gradient | boolean | false | Add background gradiant default |
color | string | #59df7a | Set color of clock canvas |
dateColor | string | #09b8be | Set color of date and time inside the clock |
locales | array | 'es-ES' | Set locale language |
optionsLocaleDate | object | required | Set locale options for toLocaleDateString function |
optionLocaleTime | object | required | Set locale options for toLocaleTimeString function |
License
MIT © merq-rodriguez