JSPM

react-native-inline-timepicker

1.2.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 13
  • Score
    100M100P100Q46500F
  • License ISC

A simple android and ios timepicker which can be used inline with other react-native components.

Package Exports

  • react-native-inline-timepicker

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-native-inline-timepicker) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

react-native-inline-timepicker

npm version npm downloads

This is a react-native timepicker for android and ios apps which will be rendered inline with other components. It may be used along with this inline datepicker.

Getting Started

Installation

$ npm install react-native-inline-timepicker --save

Usage

Import

import InlineTimePicker from 'react-native-inline-timepicker';

Example

import InlineTimePicker from 'react-native-inline-timepicker';
import React, { Component } from 'react';
import { View, Text } from 'react-native';

export default class TimePickerDemo extends Component {
  state = {
    hours: 12,
    minutes: 0,
    seconds: 0,
    meridian: "AM"
  };
  setTime = (h, m, s, mn) => {
    this.setState({hours: h, minutes: m, seconds: s, meridian: mn});
  }
  render() {
    return (
            <View>
              <InlineTimePicker onChangeTime = {this.setTime}/>
              <Text>The selected time is:</Text>
              <Text>
                {this.state.hours}:{this.state.minutes}:{this.state.seconds}{" "}{this.state.meridian}
              </Text>    
            </View>
    );
  }
}

Props

Prop Default Type Description
onChangeTime null func Callback function taking four arguments (hours, minutes, seconds, meridian) to take the user selected hours, minutes, seconds and meridian (AM or PM) respectively.
startTime null Array An array containing three numbers and a string to set the current time of the timepicker. The first element is the hours, the second element is the minutes, the third is seconds and the string represents the meridian.
mode24hrs undefined boolean If true, it changes the time mode from meridian based to 24hrs based.
skinColor null enum("white", "red", "green", "blue") Predefined skin colors for the time picker which provides style alternatives without defining the color properties described below. See below for effects.
fontSize 35 number The font size of all the texts in the timepicker except the meridian.
textColor #ccc string Text color.
textBorderColor #555 string Border color of the background color of the texts.
borderRadius 4 number The border radius of the background of the texts.
textBackgroundColor "#555" string The background color of the texts.
iconSize 40 number The size of the increment icons (+ and -).
activeTextBackgroundColor #000 string Background color active texts.
containerBackgroundColor #222 string Background color the main container.

skinColor prop

The optional skinColor property can have values of "white", "red", "green" or "blue" with the following effects.

Default

Screenshot

skinColor = 'white'

Screenshot

skinColor = 'red'

Screenshot

skinColor = 'green'

Screenshot

skinColor = 'blue'

Screenshot

Issues or suggestions?

If you have any issues or want to suggest something , your can write it here.