Skip to content

ebrahimfallah/react-modern-time-picker

Repository files navigation

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

Name Type Description
is24HourFormat boolean 12 or 24 hour format
withSeconds boolean Adding seconds to time
defaultValue string Default time value
theme light, dark Change time picker theme
onChange (value: string) => void Callback 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)
   }}
/>

About

A Time Picker component for React.js

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published