1.3.11 • Published 2 years ago

react-native-simple-time-picker v1.3.11

Weekly downloads
612
License
MIT
Repository
github
Last release
2 years ago
iOSAndroid

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

PropertyTypeDefaultDescription
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
onChangeFunctionCallback function for when values are changed ({ hours: number, minutes: number }) => void
pickerShowsArray["hours", "minutes"]Pickers to display (e.g. ["hours", "minutes", "seconds"])
hoursUnitString''Hours Unit for label
minutesUnitString''Minutes Unit for label
secondsUnitString''Seconds Unit for label
zeroPaddingBooleanfalseWhether to pad numeric labels with zero
textColorStringColor of the picker item's text
hoursIntervalInteger1
minutesIntervalInteger1
secondsIntervalInteger1
emptyLabelStringundefinedEnable empty option with this label
isAmpmBooleanfalseWhether 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