1.0.1 • Published 1 year ago

react-clock-emoji v1.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

React Clock Emoji

Simple component that renders the closest clock emoji to the current time.

Installation

npm install react-clock-emoji

Usage

import React from 'react'

import ClockEmoji from 'react-clock-emoji'

const App = () => {
  return <ClockEmoji time={"15:45"} defaultTime={"12:00"}/>
}

Props

NameTypeDefaultDescription
timestring \| number \| Date \| undefinednullTime to render the clock emoji for.
defaultTimestring \| number \| DatenullTime to render the clock emoji for if time is null.

If time is a number, it is assumed to be the number of minutes since midnight. If time is a string, it is assumed to start with "HH:mm".

Time will always be modulates to ensure it is within the allowed range.

1.0.1

1 year ago

1.0.0

1 year ago