0.9.3 • Published 5 years ago

@miidx/rn-simple-picker v0.9.3

Weekly downloads
1
License
ISC
Repository
github
Last release
5 years ago

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

NameDescriptionTypeRequiredDefault Value
animationTypeAnimation type when opening drop down. fade or sliedeStringfade
labelPicker labelString
errorError message to be shownString
separatorColorColor for line separator between itemsString#EEEEEE
enabledColorColor for the control when in enabled modeString#2f2f2f
disabledColorColor for the control when in disabled modeString#8C8C8C
cancelCaptionCaption for cancel buttonStringCancel
okCaptionCaption for OK buttonStringOK
disabledSet the control to disabled modebooleanfalse
itemTextStyleStyle for drop down item textobject{}
selectedValueSet or get selected valuestring or object
onValueSelectedCallback when user select a valuefunction
dataitems to be selected. Can be array of string or array of object with label and value fieldsarray[]