0.0.2 • Published 7 months ago

react-native-modal-time-picker v0.0.2

Weekly downloads
-
License
UNLICENSED
Repository
github
Last release
7 months ago

react-native-modal-time-picker

PRs Welcome

Note: Make sure you have install react-native-reanimated, react-native-gesture-handler,@react-native-masked-view/masked-view instructions till step, before proceeding.

Installation

using yarn:

yarn add react-native-modal-time-picker

using npm:

npm install --save react-native-modal-time-picker

Usage

import React, {useState} from 'react';
import TimePicker from 'react-native-modal-time-picker';

function App() {
  const [visible, setVisible] = useState(false);

  const openTimePicker = () => {
    setVisible(true);
  };

  const closeTimePicker = () => {
    setVisible(false);
  };

  return (
    <TimePicker
      visible={visible}
      handelChange={e => console.log(e)}
      onPressCancel={closeTimePicker}
      onPressConfirm={closeTimePicker}
      confirmButtonText={'Confirm'}
      cancelButtonText={'Cancel'}
    />
  );
}

Props

Basic

PropTypeDescriptionDefault
handelChangefnfunction return an objectfn
visibleboolShow / Hide date pickerfalse
onPressCancelfnfunction trigger when user click on cancel button-
onPressConfirmfnfunction trigger when user click on confirm button-
styleobjectsee style props{}
headerReactNodecustom header-
confirmButtonTextstringconfirm button textOk
cancelButtonTextstringcancel button textCancel

Styling

PropTypeDescriptionDefault
buttonsContainerStyleProp<ViewStyle>footer button container style-
cancelButtonStyleProp<ViewStyle>footer cancel button style-
confirmButtonStyleProp<ViewStyle>footer confirm button style-
footerButtonStyleProp<ViewStyle>footer buttons style-
footerButtonsTextStyleProp<TextStyle>footer button text style-
cancelButtonTextStyleProp<TextStyle>cancel button text style-
confirmButtonTextStyleProp<TextStyle>confirm button text style-
timeTextStyleProp<TextStyle>picker time text style-
timeTextContainerStyleProp<ViewStyle>picker time container style-

Authors

See also the list of contributors who participated in this project.

Contributing

We welcome contributions to react-native-modal-time-picker.

If you have an idea for a new feature or have discovered a bug, please open an issue.

Don't forget to add a title and a description explaining the issue you're trying to solve and your proposed solution.

Screenshots and Gifs are VERY helpful to add to the PR for reviews.

Please DO NOT format the files - we're trying to keep a unified syntax and keep the reviewing process fast and simple.

Questions

Feel free to Contact me or Create an issue