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

@bpm-sekeh/react-native-wheely

v1.0.0

Published

An all JavaScript, highly customizable wheel picker for react-native.

Downloads

8

Readme

react-native-wheely

CircleCI npm package npm downloads

An all JavaScript, highly customizable wheel picker for react native.

Installation

Install with npm

npm install --save react-native-wheely

Install with yarn

yarn add react-native-wheely

Usage

import React, { useState } from 'react';
import WheelPicker from 'react-native-wheely';

function CityPicker() {
  const [selectedIndex, setSelectedIndex] = useState(0);

  return (
    <WheelPicker
      selectedIndex={selectedIndex}
      options={['Berlin', 'London', 'Amsterdam']}
      onChange={(index) => setSelectedIndex(index)}
    />
  );
}

Props

| Name | Type | Description | | ------------------------ | ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | options | string[] | Options to be displayed in the wheel picker. Options are rendered from top to bottom, meaning the first item in the options will be at the top and the last at the bottom. | | selectedIndex | number | Index of the currently selected option. | | onChange | (index: number) => void | Handler that is called when the selected option changes. | | visibleRest | number | Amount of additional options that are visible in each direction. Default is 2, resulting in 5 visible options. | | itemHeight | number | Height of each option in the picker. Default is 40. | | itemStyle | StyleProp<ViewStyle> | Style for the option's container. | | itemTextStyle | StyleProp<TextStyle> | Style for the option's text. | | containerStyle | StyleProp<ViewStyle> | Style of the picker. | | selectedIndicatorStyle | StyleProp<ViewStyle> | Style of overlaying selected-indicator in the middle of the picker. | | rotationFunction | (x: number) => number | Function to determine the x rotation of items based on their current distance to the center (which is x). Default is rotation equation | | scaleFunction | (x: number) => number | Function to determine the scale of items based on their current distance to the center (which is x). Default is scale quation | | opacityFunction | (x: number) => number | Function to determine the opacity of items based on their current distance to the center (which is x). Default is opacity equation | | decelerationRate | "normal", "fast", number | How quickly the underlying scroll view decelerates after the user lifts their finger. See the ScrollView docs. Default is "fast". | | containerProps | ViewProps | Props that are applied to the container which wraps the FlatList and the selected indicator. | | flatListProps | FlatListProps | Props that are applied to the FlatList. |

Memoization

The individual items in the picker (<WheelPickerItem />) are strictly memoized, meaning that they will not rerender after the initial render. Rerendering the picker items uncontrollably would lead to bad performance with large number of options. Item styles, animation functions and other parameters of items therefore must be static and changes to them after the initial render will have no effect.