1.0.0 • Published 6 months ago

react-modern-time-picker v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

React Modern Time Picker

demo

Install

npm i react-modern-time-picker

How to use

First, import the library and styles file.

import TimePicker from 'react-modern-time-picker';
import 'react-modern-time-picker/dist/styles.css';

Then use the component:

<TimePicker />

Props

NameTypeDescription
is24HourFormatboolean12 or 24 hour format
withSecondsbooleanAdding seconds to time
defaultValuestringDefault time value
themelight, darkChange time picker theme
onChange(value: string) => voidCallback method
  • The value type is string with the format 00:00:00 or 00:00.
  • All props ​​are optional.
  • If defaultValue not provided, the current time will be used instead.

Example

<TimePicker
   defaultValue='13:00'
   theme='dark'
   is24HourFormat={true}
   withSeconds={false}
   onChange={(value) => {
      console.log(value)
   }}
/>