0.2.12 • Published 3 years ago

react-native-multi-options v0.2.12

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

React Native Select

npm version

A simple select component for React Native.

react-native-multi-options

TODO

  • Add support for single selection
  • Add support for multiple selections
  • Add support for disabled options
  • Add support for disabled select
  • Add support for placeholder
  • Add search functionality
  • Add support for placeholder color
  • Add tests
  • Add support for custom components
  • Add support for custom styles
  • Add support for custom placeholder
  • Add support for validation
  • GitHub Actions for CI/CD

Installation (Not available yet)

npm install react-native-multi-options

Usage

import React from 'react';
import { View } from 'react-native';
import Select from 'react-native-multi-options';

const options = [
  { label: 'One', value: 'one' },
  { label: 'Two', value: 'two' },
  { label: 'Three', value: 'three' },
];

const App = () => {
  const [value, setValue] = React.useState('one');

  return (
    <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
      <Select
        multiple
        options={options}
        value={value}
        onChange={(option) => setValue(option)}
        disabledOptions={[options[1]]}
        borderColor="red"
      />
    </View>
  );
};

Props

PropTypeDefaultDescription
optionsArray[]Options to be displayed in the select
valueStringValue of the selected option
onChangeFunctionCallback function to be called when an option is selected
multipleBooleanfalseWhether the select should allow multiple selections
disabledBooleanfalseWhether the select should be disabled
placeholderStringSelect...Placeholder text to be displayed when no option is selected
placeholderTextColorString#999Placeholder text color
styleObjectStyle object to be applied to the select
optionStyleObjectStyle object to be applied to the options
optionTextStyleObjectStyle object to be applied to the option text
optionContainerStyleObjectStyle object to be applied to the option container
optionContainerTextStyleObjectStyle object to be applied to the option container text
optionSelectedStyleObjectStyle object to be applied to the selected option
optionSelectedTextStyleObjectStyle object to be applied to the selected option text
borderColorString#999Border color of the container

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library

0.2.1

3 years ago

0.2.0

3 years ago

0.2.12

3 years ago

0.2.11

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago