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

@quidone/react-native-wheel-picker

v1.0.0

Published

Picker is a UI component for selecting an item from a list of options.

Downloads

985

Readme

React Native Wheel Picker

A flexible React Native Wheel Picker for iOS and Android without using the native side.

Features

Installation

yarn add @quidone/react-native-wheel-picker

Navigation

Usage

If you want to see more examples and experiment, run the examples locally.

git clone [email protected]:quidone/react-native-wheel-picker.git
cd react-native-wheel-picker
yarn install
cd example && yarn install && yarn ios

Simple case

import React, {useState} from 'react';
import WheelPicker from '@quidone/react-native-wheel-picker';

const data = [...Array(100).keys()].map((index) => ({
  value: index,
  label: index.toString(),
}))

const App = () => {
  const [value, setValue] = useState(0);
  return (
    <WheelPicker
      data={data}
      onValueChanged={({item: {value}}) => setValue(value)}
    />
  );
};

export default App;

Native Feedback

You can trigger native sound and impact with @quidone/react-native-wheel-picker-feedback and onValueChanging event

// ...
import WheelPickerFeedback from '@quidone/react-native-wheel-picker-feedback';

const App = () => {
  return (
    <WheelPicker
      onValueChanging={() => {
        WheelPickerFeedback.triggerSoundAndImpact();
      }}
    />
  );
};

API

WheelPicker

Props

  • data [array] - items of picker
  • value? [any] - current value of picker item
  • itemHeight? [number] - height of picker item in the center.
  • width? [number | string] - width of picker.
  • onValueChanging? [function] - An event that is triggered when the value is changing.
  • onValueChanged? [function] - An event that is triggered when the value is changed (wheel is stopped and no touch).
  • keyExtractor? [function] - key extractor from picker item.
  • renderItem? [function] - render picker item content.
  • renderItemContainer? [function] - render picker item container (there is animated container).
  • renderOverlay? [function | null] - render overlay over the picker.
  • renderList? [function] - render list (Advanced, It is not recommended to use).
  • style? [object | array] - root style.
  • itemTextStyle? [object | array] - item text style for picker item.
  • overlayItemStyle? [object | array] - style for the overlay element in the center
  • scrollEventThrottle? [object | array] - original

usePickerItemHeight

This hook returns the item height which was passed via props.

useScrollContentOffset

This hook returns the animated value of the ScrollView offset.

withVirtualized

This HOC returns virtualized picker

import WheelPicker, {withVirtualized} from '@quidone/react-native-wheel-picker';

const VirtualizedWheelPicker = withVirtualized(WheelPicker);

Additional props

  • initialNumToRender? (default = 3) - original.
  • maxToRenderPerBatch? (default = 3) - original.
  • windowSize? - original.
  • updateCellsBatchingPeriod? (default = 10) - original.

👨‍💻 Author

Sergey Rozhkov

🎯 Was it helpful?

Do you like it and find it helpful? You can help this project in the following way:

  • ⭐ Put the star.
  • 💡 Suggest your ideas.
  • 😉 Open a founded issue.

🤝 Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

📄 License

Quidone React Native Wheel Picker is MIT licensed, as found in the LICENSE file.


Made with create-react-native-library