react-native-timeslots-picker
TypeScript icon, indicating that this package has built-in type declarations

0.0.8 • Public • Published

React Native Time Slot Picker

npm version downloads MIT License

Simple TimeSlot Picker for React Native.

Requirements

  • React Native 0.60 or higher
  • Moment.js
  • NativeBase

Installation with NPM

npm install react-native-timeslots-picker --save

Installation with Yarn

yarn add react-native-timeslots-picker

Usage

import {TimeSlotPicker} from "react-native-timeslots-picker";

...

const [selectedTimeSlot, setSelectedTimeSlot] = useState(null);

return (
  <Box>
    <TimeSlotPicker
          slotResult={slot => {
            setSelectedTimeSlot(slot);
          }}
          timeSlotInterval={15}
          weekDayFromTime={'08:00'}
          weekDayToTime={'18:00'}
          weekendFromTime={'08:00'}
          weekendToTime={'12:00'}
        />
    <Text>Select Time Slot: {selectedTimeSlot}</Text>
  </Box>
)

Props

Prop Type Default Description
slotResult function null Callback function to get selected time slot
weekDayFromTime string '08:00' Weekday start time
weekDayToTime string '18:00' Weekday end time
weekendFromTime string '08:00' Weekend start time
weekendToTime string '12:00' Weekend end time
timeSlotInterval number 15 Slot interval in minutes
disableHeader boolean false Disable header shown

Screenshots

Screenshot

License

ISC

Package Sidebar

Install

npm i react-native-timeslots-picker

Weekly Downloads

4

Version

0.0.8

License

ISC

Unpacked Size

39.6 kB

Total Files

9

Last publish

Collaborators

  • kevtucker