0.1.4 • Published 2 years ago
hidden-meddarhri-test v0.1.4
React-Ios-Time-Picker
A modern time picker for your next React app.
- Supports virtually any language
- No moment.js needed
- almost zero dependencies
install
npm install react-ios-testing-here
Usage
import React, { useState } from 'react';
import TimePicker from 'react-time-picker';
function MyApp() {
const [value, onChange] = useState('10:00');
return (
<div>
<TimePicker onChange={onChange} value={value} />
</div>
);
}
API
TimePicker
Name | Type | Default | Description |
---|---|---|---|
value | String | null | current value. |
cellHeight | number | 35 | the height of the cell number. |
placeHolder | string | 'Select time' | time input's placeholder. |
pickerDefaultValue | string | '00:00' | the initial value that the picker begin with in the first time. |
disabled | Boolean | false | whether picker is disabled. |
isOpen | boolean | false | Whether the time picker should be opened. |
required | boolean | false | Whether time input should be required. |
cancelButtonText | string | 'Cancel' | cancel button text content |
saveButtonText | String | 'Save' | cancel button text content |
controllers | boolean | true | Whether the buttons should be displayed |
seperator | boolean | true | whether show the colon seperator |
id | String | '' | time picker id |
onChange | (value) => alert('New time is: ', value) | null | called when select a different value |
onSave | (value) => alert('Time saved is: ', value) | When the user clicks on save button | |
onClose | () => alert('Clock closed') | when the user clicks on cancel button |
License
The MIT License.