edivangalindo / picker-time

An "picker-time" React component

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

picker-time

npm package

A simple React component, initially developed to create a schedule time table but you can use it for other purposes.

picker-time

How to use ?

First install the package:

$ yarn add picker-time

or:

$ npm install picker-time

Example

import React from 'react';
import { render } from 'react-dom';
import PickerTime from 'picker-time';

const items = [
  {
    id: '1',
    text: '10:00',
    onClick: () => alert('10:00')
  },
  {
    id: '2',
    text: '11:00',
    onClick: () => alert('11:00')
  },
  {
    id: '3',
    text: '12:00',
    onClick: () => alert('12:00')
  }
];

const Demo = () => (
  <>
    <h1>picker-time Demo</h1>
    <PickerTime items={items} width={500} />
  </>
);

About

An "picker-time" React component


Languages

Language:JavaScript 100.0%