Skip to content

Repository files navigation

React-Native-Picker

React-Native-Picker component is a customizable and easy-to-use package for implementing a wheel picker UI in your React Native applications. This component allows users to select options by spinning a wheel-like interface, making it ideal for scenarios where you need to choose values from a list or perform date and time selections.

Suitable for both Android and Iphone

Installation

npm i react-native-picker-component

Usage

import Picker from 'react-native-picker-component'

Preview

IOSAndroid

Usage

exportdefaultfunctionApp(){constdata=[{id: 1,city: "İstanbul"},{id: 2,city: "Ankara"},{id: 3,city: "İzmir"},{id: 4,city: "Antalya"},{id: 5,city: "Bursa"}]const[visible,setVisible]=useState(false)return(<Viewstyle={styles.container}><TouchableOpacityonPress={()=>{setVisible(true)}}style={styles.button}><Textstyle={styles.buttonText}>Button</Text></TouchableOpacity><Pickerdata={data}selectText={"city"}selectedItem={(item)=>{console.log("Selected Item",item)}}visible={visible}setVisible={setVisible}/></View>);}

Props

PropsRequiredDescription
datatrueArray
selectedTexttrueitem of object that will be shown on picker
selectedItemtruereturns selected object
visibletrueshow modal state
setVisibletrueclose modal state
cancelButtonTextfalsecancel button text chould change
saveButtonTextfalsesave button text chould change

About

React-Native-Picker component is a customizable and easy-to-use package for implementing a wheel picker UI in your React Native applications.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages