react-native-combobox
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

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)

Property Type Required Default Description
values Array<string> yes - array of strings
onValueSelect function yes - returns the selected index
fontFamily string (font) no - -
textColor string (color) no - -
backgroundColor string (color) no - -
fontSize number no - -
defaultValue string no ' ' -
rtl boolean no false -



License

This project is licensed under the MIT License

Package Sidebar

Install

npm i react-native-combobox

Weekly Downloads

32

Version

1.0.1

License

MIT

Unpacked Size

8.28 kB

Total Files

5

Last publish

Collaborators

  • d10s_avinu