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-picker-mb

v0.1.3

Published

A picker component for mobile device

Downloads

6

Readme

React Picker Mobile

React Picker Mobile is a component very easy to use with no extra effort. It can be used in any project with great performance!

How to install

npm install react-picker-mb --save

How to use

ES6

import Picker from 'react-picker-mb';

CommonJS

var Picker = require('react-picker-mb');

Properties

| Name | Type | Default | Description | |------------------|----------|----------|--------------------------------------------------------------------------------------------------------------------------------------------| | itemHeight | Number | 36 | Height of each row in picker (px). | | visibleItemCount | Number | 5 | Count of visible items in picker. | | showToolbar | Boolean | false | If true, a customized toolbar would appear in picker. | | rotateEffect | Boolean | false | If true, picker will be in 3D mode; otherwise, picker will be in 2D. | | pickerSlots | Array | [] | Array of pickers is used in total. Each item of this array will implement an individual picker(pickerSlot). | | onChange | Function | () => {} | This accepts a callback function for picker to output result. Picker result will be in format of array, for example, ['2015', '01', '02']. |

PickerSlot

| Name | Type | Default | Description | |----------------|---------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | options | Array | [] | Array of each picker's options. item of array can be one of type: String, Number, Boolean, Object. If it's an object, property dataKey then is required so that picker knows what values to use. | | dataKey | String | "" | Optional property, is required when options array includes objects. Use this key to get values of option object. | | defaultIndex | Number | 0 | Set default value of picker by index. | | divider | Boolean | false | If true, a divider column is created. | | dividerContent | String | "-" | If divider is true, dividerContent will be used for displaying the divider column. It can be rich HTML string. | | className | String | "" | Customized class for the picker column. | | flex | Number | 0 | Optional property. Picker columns apply flex layout. Bigger value will result in a larger column. | | textAlign | String | 'center' | Can be 'left/center/right'. Text alignment of the picker column. |

Getting Started

To play it yourself, you can clone this repo and run the example in your local space.

Or you can play with the picker Online here

git clone https://github.com/jessemao/react-picker-mobile.git
cd react-picker-mobile && cd example
npm install
npm start

The code example as below:

import React from 'react';
import ReactDOM from 'react-dom';
import Picker from 'react-picker-mb';
import './index.css';

ReactDOM.render(<Picker
    pickerSlots={[{
      flex: 1,
      options: [{
        id: '0'
      }, {
        id: '1'
      }, {
        id: '2'
      }, {
        id: '3'
      }, {
        id: '4'
      }],
      defaultIndex: 2,
      dataKey: 'id',
      className: 'slot1',
      textAlign: 'right',
    }, {
      divider: true,
      dividerContent: '-',
      className: 'slot2'
    }, {
      flex: 1,
      options: ['2015-01', '2015-02', '2015-03', '2015-04', '2015-05', '2015-06'],
      className: 'slot3',
      textAlign: 'left'
    }]
  }
  visibleItemCount={ 5 }
  onChange={ (res) => console.log(res) }
/ >,
document.getElementById('root')
);

License

MIT