Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-time-picker-ios-like-v2

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-time-picker-ios-like-v2

A modern time picker for your React app.

  • 0.2.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

npm downloads

React ios time picker

React-ios-time-picker demo

A modern time picker for your next React app.

  • No moment.js needed
  • Zero dependencies and lightweight

install

npm install react-ios-time-picker

Usage

24 hours format

24 hours format

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

export default const  MyApp = () => {
   const [value, setValue] = useState('10:00');

   const onChange = (timeValue) => {
      setValue(timeValue);
   }

   return (
      <div>
         <TimePicker onChange={onChange} value={value} />
      </div>
   );
}

12 hours format

12 hours format

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

export default const  MyApp = () => {
   const [value, setValue] = useState('10:00 AM');

   const onChange = (timeValue) => {
      setValue(timeValue);
   }

   return (
      <div>
         <TimePicker onChange={onChange} value={value} use12Hours/>
      </div>
   );
}

API

NameTypeDefaultDescription
valueStringn/aCurrent value.
cellHeightNumber35The height of the cell number.
placeHolderString"Selet_time"Time input's placeholder.
pickerDefaultValueString"00:00"The initial value that the picker begin with in the first time.
disabledBooleanfalseWhether picker is disabled.
isOpenBooleanfalseWhether the time picker should be opened.
requiredBooleanfalseWhether time input should be required.
cancelButtonTextString"Cancel"Cancel button text content
saveButtonTextString"Save"Save button text content
controllersBooleantrueWhether the buttons should be displayed
seperatorBooleantruewhether show the colon seperator
idStringn/aInput time picker id
nameStringn/aInput time picker name
use12HoursBooleanfalse12 hours display mode
inputClassNameStringn/aInput time picker className
popupClassNameStringn/atime picker popup className
onChange(value) => alert ('New time is: ', value)n/aCalled when select a different value
onSave(value) => alert ('Time saved is: ', value)n/aWhen the user clicks on save button
onClose() => alert('Clock closed')n/aWhen the user clicks on cancel button
onAmPmChange(value) => alert('Am/Pm changed : value')n/acalled when select an am/pm value
onOpen() => alert('time picker opened')n/acalled when time picker is opened

Contributions Welcome!

git clone https://github.com/MEddarhri/react-ios-time-picker
cd react-ios-time-picker

License

The MIT License.

Keywords

FAQs

Package last updated on 18 Oct 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc