1.0.1 • Published 4 years ago

@berserk-code/react-clock v1.0.1

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

@berserk-code/react-clock

Made with create-react-library

NPM JavaScript Style Guide

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

PropertyTypeDefaultDescription
gradientbooleanfalseAdd background gradiant default
colorstring#59df7aSet color of clock canvas
dateColorstring#09b8beSet color of date and time inside the clock
localesarray'es-ES'Set locale language
optionsLocaleDateobjectrequiredSet locale options for toLocaleDateString function
optionLocaleTimeobjectrequiredSet locale options for toLocaleTimeString function

License

MIT © merq-rodriguez