Skip to content

Dropdown picker for both IOS and Android on React Native

Notifications You must be signed in to change notification settings

miidx/rn-simple-picker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rn-simple-picker

Usage

    <SimplePicker  
        animationType="fade"
        label="City"
        selectedValue={this.state.pickerValue}
        onValueSelected={(pickerValue) => this.setState({ pickerValue }) }
        itemTextStyle={{fontSize: 14}}
        data={['Jakarta', 'Surabaya', 'Semarang']}
    />

    <SimplePicker  
        animationType="fade"
        label="City"
        selectedValue={this.state.pickerValue}
        onValueSelected={(pickerValue) => this.setState({ pickerValue }) }
        itemTextStyle={{fontSize: 14}}
        data={[ 
            { value: 'jkt', label: 'Jakarta' },
            { value: 'sby', label: 'Surabaya' },
            { value: 'smg', label: 'Semarang' },
        ]}
    />

Properties

Name Description Type Required Default Value
animationType Animation type when opening drop down. fade or sliede String fade
label Picker label String
error Error message to be shown String
separatorColor Color for line separator between items String #EEEEEE
enabledColor Color for the control when in enabled mode String #2f2f2f
disabledColor Color for the control when in disabled mode String #8C8C8C
cancelCaption Caption for cancel button String Cancel
okCaption Caption for OK button String OK
disabled Set the control to disabled mode boolean false
itemTextStyle Style for drop down item text object {}
selectedValue Set or get selected value string or object
onValueSelected Callback when user select a value function
data items to be selected. Can be array of string or array of object with label and value fields array []

About

Dropdown picker for both IOS and Android on React Native

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published