react-time-picker-roll
TypeScript icon, indicating that this package has built-in type declarations

0.1.5 • Public • Published

npm downloads NPM Downloads

React time picker roll

A Simple time picker roll for React or Next app.

install


npm install react-time-picker-roll

Usage

import React, { useState } from 'react';
import { TimePickerComponent } from 'my-time-picker';


export default const  MyApp = () => {
  // initialTime
   const [value, setValue] = useState({ hours: 6, minutes: 0, period: 'AM' });

  // onChange
    const handleTimeChange = (time: {
      hours: number;
      minutes: number;
      period: string;
    }) => {
      console.log(time);
      setValue(time)
    };


   return (
      <div>
        <TimePickerComponent
          initialTime={value}
          onChange={handleTimeChange} />

       <p>Selected Time: {value} </p>
      </div>
   );
}

API

Name Type Default Description
value String n/a Current value.
name String n/a Input time picker name
onChange (value) => alert('New time is:', value) n/a Called when select a different value

License

The MIT License.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.1.50latest

Version History

VersionDownloads (Last 7 Days)Published
0.1.50
0.1.41
0.1.30
0.1.20
0.1.10
1.0.241
1.0.231
1.0.221
1.0.211
1.0.201
1.0.192
1.0.181
1.0.171
1.0.152
1.0.144
1.0.132
1.0.121
1.0.111
1.0.101
1.0.93
1.0.80
1.0.70
1.0.60
1.0.50
1.0.40
1.0.30
1.0.20
1.0.10

Package Sidebar

Install

npm i react-time-picker-roll

Weekly Downloads

24

Version

0.1.5

License

MIT

Unpacked Size

102 kB

Total Files

12

Last publish

Collaborators

  • metwally98