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 🙏

© 2025 – Pkg Stats / Ryan Hefner

expo-wheelpicker

v1.0.0

Published

A simple and usefull Wheelpicker

Readme

Expo WheelPicker

A bottom-sheet style wheel picker component for React Native and Expo. It provides a scrollable “wheel” selector inside a modal that slides up from the bottom of the screen with a dark semi-transparent backdrop.

This is a JavaScript-only implementation. It runs in Expo Go without any native code or custom builds.

Installation

yarn:

yarn add expo-wheelpicker 

npm:

npm install expo-wheelpicker

Example

import React, { useState } from 'react';
import { View, Button } from 'react-native';
import WheelPicker, { PickerItem } from 'expo-wheelpicker';

export default function App() {
  // Type the items array with PickerItem[]
  const [items, setItems] = useState<PickerItem[]>([
    { label: 'Option 1', value: '1', isSelected: false },
    { label: 'Option 2', value: '2', isSelected: false },
    { label: 'Option 3', value: '3', isSelected: false },
  ]);

  const [visible, setVisible] = useState(false);

  return (
    <View style={{ flex: 1, justifyContent: 'center' }}>
      <Button title="Open Picker" onPress={() => setVisible(true)} />
      <WheelPicker
        visible={visible}
        items={items}
        setVisible={() => setVisible(false)}
        handleSelectItem={(item: PickerItem) => {
          console.log('Selected:', item.value);
        }}
      />
    </View>
  );
}

Component API

PickerItem

Each item displayed in the wheel is defined by a PickerItem.
This type lets you specify both the text shown in the picker and the associated value returned when the user makes a selection.

| Property | Type | Description | | :----------- | :------ | :-------------------------------------------------------------------------- | | label | string | Text shown to the user in the wheel. | | value | string | Value associated with the item; returned by the selection callback. | | isSelected | boolean | Indicates whether this item is currently selected. Managed internally, but can be used for custom styling if needed. |

WheelPicker Parameters

| Parameter | Type | Description | | :------------------- | :---------------------------- | :--------------------------------------------------------------------------- | | visible | boolean | Required. Controls the visibility of the modal. | | items | PickerItem[] | Required. Array of picker items, each with a label and value. | | setVisible | () => void | Required. Callback to hide the modal (e.g. () => setVisible(false)). | | handleSelectItem | (item: PickerItem) => void | Required. Callback fired when the user confirms the selected item. | | initialIndex | number | Optional. Index of the item initially selected. | | title | string | Optional. Text displayed at the top of the modal. | | selectLabel | string | Optional. Text for the confirm/selection button. | | cancelLabel | string | Optional. Text for the cancel button. | | selectButtonColor | string (can use rgba) | Optional. Color of the confirm/selection button text. | | cancelButtonColor | string (can use rgba) | Optional. Color of the cancel button text. | | itemLabelColor | string (can use rgba) | Optional. Color of the label text for each wheel item. | | highLightColor | string (can use rgba) | Optional. Color of the highlight indicator showing the selected row. | | visibleCount | number | Optional. Number of items visible in the wheel at one time. | | minScale | number | Optional. Minimum scale factor for non-selected items. Default: 0.75. | | minOpacity | number | Optional. Minimum opacity for non-selected items. Default: 0.35. |

Interesting techniques

  • Uses the built-in Modal component with animationType="slide" to create the bottom-sheet transition.
  • Implements a wheel selector with a FlatList and snapToInterval for smooth snapping to each item.
  • Applies flexible styling with StyleSheet and conditional padding to support both iOS and Android safe areas.
  • These are all standard React Native APIs, making the component portable and easy to maintain.

Project structure

.
├─ src/
│  ├─ ExpoPickerButtonGroupView.tsx
│  ├─ ExpoPickerContainerView.tsx
│  ├─ ExpoPickerRenderItemView.tsx
│  ├─ ExpoWheelpickerStyles.ts
│  ├─ ExpoWheelpickerView.tsx
│  ├─ ExpoWheelpickerView.web.tsx
│  ├─ ExpoWheelpicker.types.ts
│  └─ index.ts
├─ example/               # Expo app demonstrating the component
├─ package.json
├─ tsconfig.json
└─ README.md