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-native-wheel-pick-2

v1.0.2

Published

React native wheel picker iOS style with android.

Downloads

182

Readme

react-native-wheel-pick-2

This package is an updated version of react-native-wheel-pick with dependencies.

React native wheel picker for both iOS and android. (Support DatePicker)

Preview

Note

How to use

React Native >= 0.60+

npm install react-native-wheel-pick-2 --save --legacy-peer-deps
npm install @react-native-picker/picker --save --legacy-peer-deps
npm install @react-native-community/datetimepicker --save --legacy-peer-deps
npx pod-install

npx react-native run-ios // re-build native-code
npx react-native run-android // re-build native-code for gradle

React Native < 0.60

npm install react-native-wheel-pick-2
react-native link react-native-wheel-pick-2

Example code

import { Picker, DatePicker } from 'react-native-wheel-pick-2';

// use Picker
<Picker
  style={{ backgroundColor: '#333', width: 300, height: 215 }}
  textColor={"#f1f1f1"}
  selectedValue='item4'
  pickerData={['item1', 'item2', 'item3', 'item4', 'item5', 'item6', 'item7']}
  onValueChange={value => { console.log(value) }}
/>

// use DatePicker
<DatePicker
  style={{ backgroundColor: 'white', width: 370, height: 240 }} 
  onDateChange={date => { console.log(date) }}
/>

More Example

// DatePicker set default select date
<DatePicker
  style={{ height: 215, width: 300 }}
  date={new Date('2018-06-27')} // Optional prop - default is Today
  onDateChange={date => { console.log(date) }}
/>

// DatePicker set min/max Date
<DatePicker
  style={{ height: 215, width: 300 }}
  minimumDate={new Date('2000-01-01')}
  maximumDate={new Date('2050-12-31')}
  onDateChange={date => { console.log(date) }}
/>
// pickerData also support array of object.

// Way 1
<Picker
  selectedValue='item4'
  pickerData={['item1', 'item2', 'item3', 'item4', 'item5', 'item6', 'item7']}
  onValueChange={value => { console.log(value) }}
/>

// Optional Way 2
<Picker
  style={{ backgroundColor: 'white', width: 300, height: 215 }}
  selectedValue='5765387680'
  pickerData={[
    { value : '5765387677', label : 'item1' },
    { value : '5765387678', label : 'item2' },
    { value : '5765387679', label : 'item3' },
    { value : '5765387680', label : 'item4' },
    { value : '5765387681', label : 'item5' },
    { value : '5765387682', label : 'item6' },
    { value : '5765387683', label : 'item7' },
  ]}
  onValueChange={value => { console.log(value) }}
/>
// Android Only.
// These is special props for Android. (iOS not work)
// You can also use these props for DatePicker, too.
<Picker
  textColor='red'
  textSize={20}

  selectTextColor='green'
  isShowSelectBackground={false} // Default is true
  selectBackgroundColor='#8080801A' // support HEXA color Style (#rrggbbaa)
  // (Please always set 'aa' value for transparent)
  
  isShowSelectLine={false} // Default is true
  selectLineColor='black'
  selectLineSize={6} // Default is 4
/>

// Android Only.
<DatePicker
  order='D-M-Y' // Default is M-D-Y
/>

Release Note

[Android]

  • Update sdk support for SDK Version 33 (Google Play need sdk version 30+)

PROPS

| Prop | Type | Default | Description | |---------------|----------------------|---------|-------------------------------------------------------| | date | instanceOf(Date) | | The initial date to be displayed. | | maximumDate | instanceOf(Date) | | The maximum date that can be selected. | | minimumDate | instanceOf(Date) | | The minimum date that can be selected. | | mode | oneOf(['date', 'time', 'datetime']) | 'date' | The display mode for the date picker. | | onDateChange | func.isRequired | | Callback function to be called when the date changes. |

| Prop | Type | Default | Description | |---------------|----------------------|-----------|-------------------------------------------------------| | textColor | string | '#333' | The color of the text in the picker. | | textSize | number | 26 | The size of the text in the picker. | | itemStyle | object | null | The style for the picker items. | | onValueChange | func.isRequired | | Callback function to be called when the value changes.| | pickerData | array.isRequired | | The data for the picker items. | | style | object | {} | The style for the picker container. | | selectedValue | any | '' | The initially selected value in the picker. |