1.0.1 • Published 4 years ago

react-native-combobox v1.0.1

Weekly downloads
2
License
MIT
Repository
-
Last release
4 years ago

react-native-combobox

Supports Android and iOS    MIT License

Customizable combo-box for react native apps

Please let me know if you encounter any issues or if you have any imporvements suggestion, comments, etc..

Getting started

npm i react-native-combobox

Usage

Example

Example - code

import ComboBox from 'react-native-combobox';
    const [selectedValue, setSelectedValue] = useState('');
    
    const values = [
        'option 1',
        'option 2',
        'option 3',
        'option 4',
        'option 5'
    ];

    return (
        <View style={{ flex: 1, paddingVertical: 80, paddingHorizontal: 40, justifyContent: 'space-between' }}>
            <ComboBox
                values={values}
                onValueSelect={setSelectedValue}
            />
            <Text>selected value:          {values[selectedValue]}</Text>
        </View>
    );

API - Combobox (default import)

PropertyTypeRequiredDefaultDescription
valuesArray\yes-array of strings
onValueSelectfunctionyes-returns the selected index
fontFamilystring (font)no--
textColorstring (color)no--
backgroundColorstring (color)no--
fontSizenumberno--
defaultValuestringno' '-
rtlbooleannofalse-

License

This project is licensed under the MIT License