1.3.11 • Published 2 years ago
react-native-simple-time-picker v1.3.11
iOS | Android |
---|---|
Simple wrapper component on @react-native-picker/picker.
Install
# React Native
npm install react-native-simple-time-picker @react-native-picker/picker
npx pod-install
# Expo
expo install react-native-simple-time-picker @react-native-picker/picker
Usage
import React from 'react';
import {TimePicker, ValueMap} from 'react-native-simple-time-picker';
const YourApp = () => {
const [value, setValue] = useState<ValueMap>({
hours: 1,
minutes: 0,
seconds: 0,
});
const handleChange = (newValue: ValueMap) => {
setValue(newValue);
};
return <TimePicker value={value} onChange={handleChange} />;
};
Props
Property | Type | Default | Description |
---|---|---|---|
value | { hours: number, minutes: number, seconds: number, ampm?: 'am' \| 'pm' } | { hours: 0, minutes: 0, seconds: 0 } | Controlled state |
defaultValue | { hours: number, minutes: number, seconds: number, ampm?: 'am' \| 'pm' } | { hours: 0, minutes: 0, seconds: 0 } | Controlled state |
onChange | Function | Callback function for when values are changed ({ hours: number, minutes: number }) => void | |
pickerShows | Array | ["hours", "minutes"] | Pickers to display (e.g. ["hours", "minutes", "seconds"] ) |
hoursUnit | String | '' | Hours Unit for label |
minutesUnit | String | '' | Minutes Unit for label |
secondsUnit | String | '' | Seconds Unit for label |
zeroPadding | Boolean | false | Whether to pad numeric labels with zero |
textColor | String | Color of the picker item's text | |
hoursInterval | Integer | 1 | |
minutesInterval | Integer | 1 | |
secondsInterval | Integer | 1 | |
emptyLabel | String | undefined | Enable empty option with this label |
isAmpm | Boolean | false | Whether to display am/pm picker |
ampmLocalization | { am: string, pm: string } | { am: 'am', pm: 'pm' } | Label for am/pm picker items |
Preview
https://snack.expo.io/@uraway/react-native-simple-time-picker
LICENSE
MIT
1.3.10
2 years ago
1.3.11
2 years ago
1.3.9
2 years ago
1.3.8
2 years ago
1.3.7
3 years ago
1.3.6
3 years ago
1.3.5
3 years ago
1.3.4
3 years ago
1.3.3
3 years ago
1.3.2
3 years ago
1.3.1
3 years ago
1.3.0
3 years ago
1.2.5
3 years ago
1.2.4
3 years ago
1.2.3
3 years ago
1.2.2
3 years ago
1.2.0
3 years ago
1.2.1
3 years ago
1.1.3
3 years ago
1.1.1
3 years ago
1.1.0
3 years ago
1.1.2
3 years ago
1.0.14
3 years ago
1.0.13
3 years ago
1.0.11
3 years ago
1.0.10
3 years ago
1.0.9
3 years ago
1.0.8
3 years ago
1.0.7
3 years ago
1.0.5
3 years ago
1.0.2
3 years ago
1.0.1
3 years ago
1.0.0
3 years ago
1.0.4
3 years ago
1.0.3
3 years ago
0.2.0
7 years ago
0.1.2
7 years ago
0.1.1
7 years ago
0.1.0
7 years ago