npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-wheel-time-picker

v1.2.11

Published

[![npm](https://img.shields.io/npm/v/react-wheel-time-picker)](https://www.npmjs.com/package/react-wheel-time-picker) ![downloads](https://img.shields.io/npm/dt/react-wheel-time-picker?color=blue&logo=npm&logoColor=blue)

Downloads

61

Readme

npm downloads

React wheel time picker

React-wheel-time-picker demo

A modern wheel time picker for your React app.

  • Full Typescript support
  • Dark & Light mode support
  • No moment.js needed
  • Zero dependencies and lightweight

Live demo

To see the live demo: Click here

install

npm install react-wheel-time-picker

or

yarn add react-wheel-time-picker

d.ts declaration

If you have a vite-env.d.ts or other d.ts file in your src folder you can put this

declare module 'react-wheel-time-picker'

It's for finding corresponding type of 'react-wheel-time-picker'.

Usage

24 hours format (light & dark)

24 hours format

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

export default const  App = () => {
    const [value, setValue] = useState('12:00');
    const [isDarkMode, setIsDarkMode] = useState(false);

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

   return (
      <div>
        <TimePicker
            label="Start time"
            isDarkMode={isDarkMode}
            onChange={onChange}
            value={value}
        />
      </div>
   );
}

12 hours format (light & dark)

12 hours format

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

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

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

   return (
      <div>
        <TimePicker
            use12Hours
            label="Start time"
            isDarkMode={isDarkMode}
            onChange={onChange}
            value={value}
        />
      </div>
   );
}

API

| Name | Type | Default | Description | | ------------------ | -------------------------------------------------------- | -------------- | --------------------------------------------------------------- | | label | String (optional) | n/a | Name of the input. | | isDarkMode | Boolean (optional) | n/a | for dark mode support. | | value | String | n/a | Current value. | | cellHeight | Number (optional) | 28 | The height of the cell number. | | placeHolder | String (optional) | "Selet_time" | Time input's placeholder. | | pickerDefaultValue | String (optional) | "00:00" | The initial value that the picker begin with in the first time. | | disabled | Boolean (optional) | false | Whether picker is disabled. | | isOpen | Boolean (optional) | false | Whether the time picker should be opened. | | required | Boolean (optional) | false | Whether time input should be required. | | cancelButtonText | String (optional) | "Cancel" | Cancel button text content | | saveButtonText | String (optional) | "Save" | Save button text content | | controllers | Boolean (optional) | true | Whether the buttons should be displayed | | seperator | Boolean (optional) | true | whether show the colon seperator | | id | String (optional) | n/a | Input time picker id | | name | String (optional) | n/a | Input time picker name | | use12Hours | Boolean (optional) | false | 12 hours display mode | | inputClassName | String (optional) | n/a | Input time picker className | | popupClassName | String (optional) | n/a | time picker popup className | | onChange | (value) => alert ('New time is: ', value) | n/a | Called when select a different value | | onSave | (value) => alert ('Time saved is: ', value) (optional) | n/a | When the user clicks on save button | | onClose | () => alert('Clock closed') (optional) | n/a | When the user clicks on cancel button | | onAmPmChange | (value) => alert('Am/Pm changed : value') (optional) | n/a | called when select an am/pm value | | onOpen | () => alert('time picker opened') (optional) | n/a | called when time picker is opened |

Contributions Welcome!

git clone https://github.com/rodolphe37/react-wheel-time-picker

License

The ISC License.