react-native-list-picker
The data Picker for React Native.
page 1 | page 2 |
---|---|
Installation
$ npm i react-native-list-picker --save
Example
;;; const styles = StyleSheet; let dataList = ; { StatusBar; superprops; thisstate = pickData:null } { return <View style=stylescontainer> <Text style=styleswelcome> Welcome to Picker! </Text> <ListPicker ref= { thispicker = picker; } onChange= this closeable = true isEmojiable = false dataList=dataList /> <TouchableOpacity onPress= thispicker> <Text style=styleslink> click here </Text> </TouchableOpacity> thisstatepickData && <Text style=stylesdata> JSON </Text> </View> ; }
Props
Key | Type | Default | Description |
---|---|---|---|
onChange | function | *required | The handler when a country is selected |
closeable | bool | false | If true, the ListPicker will have a close button |
isEmojiable | bool | false | If true, use emoji to render icon |
dataList | array | *required | {"letter":"","icon":"","name":""} |
dataList
"letter": "AFN" "icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAeCAIAAADRv8uKAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAAASAAAAEgARslrPgAABJ1JREFUSMfll19oU1ccx3+/c29yc2PaJG2TGFvTuljRdnViWx9sxSmlutmhFl+GCBvCQPBhyAR92VDwcb74IJTucQo+zVFQJs6/9M/AlqrB2cZqbbLYJrRNanL/5J7z20McbA/rbevci+fhcC/nz+d8fz/u73wvgl2TADjAdwBdAFkA6V+mcQZeAX1b4czXIOWBM5tt7cbfWXv/wPJKFiH+45XofwEjlkgIQKW+dA4EgGWcYHlgBCDGoLwcXC5DVaVsFnWdEUGhUCK/AzAiAnCHg2prcds2i3M5FOIjI8Q5hsNyIgFPn8Bcbum67cFUohJZTqfR1OSKRPjYmJzNOhTF8ngQQLjdptdr7d/v+flXtBKASEtg24MREYisSASiUUmWpVhMGhsDr7fg88HsrDI3Jw8NUUODjgTr15tqDqwcINrqlm2pnEiW5bpjx6RoVL13T9y4oUSjxs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f56IADgfLlGeUX2Fv5maVfkbeF9/JP4E60nG6TGip3CAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDEzLTEwLTA3VDEzOjE0OjQwKzAyOjAwHXwFzwAAACV0RVh0ZGF0ZTptb2RpZnkAMjAxMy0xMC0wN1QxMzoxNDo0MCswMjowMGwhvXMAAAAASUVORK5CYII=" "name": "阿富汗"
Dependencies
- lodash
- react-native-emoji
- world-countries
Contribution
- @liukefu The main author.
Questions
Feel free to contact me or create an issue
made with ♥