0.5.4 • Published 1 year ago

react-native-wheel-picker-expo v0.5.4

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

react-native-wheel-picker-expo

npm npm npm type definitions

React Native wheel picker like iOS without ejected Expo/CRNA

npm.io

Demo with Expo

npm.io

Installation

expo install react-native-wheel-picker-expo

or

npm install react-native-wheel-picker-expo

Sample Code

import React from 'react';
import WheelPickerExpo from 'react-native-wheel-picker-expo';

const CITIES = 'Jakarta,Bandung,Sumbawa,Taliwang,Lombok,Bima'.split(',');

function App() {
    return (
        <WheelPickerExpo
          height={300}
          width={150}
          initialSelectedIndex={3}
          items={CITIES.map(name => ({ label: name, value: '' }))}
          onChange={({ item }) => setCity(item.label)} />
    );
}

Props

PropDefaultTypeDescription
itemsArrayArray<ItemType>Data that will be rendered as options
onChange-({index, item}) => voidFunction will send item and index option selected
initialSelectedIndex-numberInital index will be selected
height200numberStyle height for container
width150numberStyle width for container
flatListProps-FlatListProps<ItemType>Props of FlatList
backgroundColor#FFFFFFstringFor best result this is necessary if background is not white. Note: Only accept hexcolor and have 7 length of string. Ex: #F00F00
selectedStyle-{ borderColor: string; borderWidth: number }Style for selected item
renderItem-(props: RenderItemProps) => JSX.ElementReturn JSX Element to override the items
hapticsfalsebooleanEnable haptic feedback

Contributing

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

License

MIT

0.5.4

1 year ago

0.5.3

1 year ago

0.5.0

2 years ago

0.5.2

2 years ago

0.5.1

2 years ago

0.4.1

3 years ago

0.4.0

3 years ago

0.4.2

3 years ago

0.3.0

3 years ago

0.2.2

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago