Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/d-a-n/react-native-multiple-choice

A cross-platform (iOS / Android) single and multiple-choice React Native component.
https://github.com/d-a-n/react-native-multiple-choice

Last synced: 5 days ago
JSON representation

A cross-platform (iOS / Android) single and multiple-choice React Native component.

Awesome Lists containing this project

README

        

# react-native-multiple-choice
A cross-platform (iOS / Android) single and multiple-choice React Native component.

## Install

```sh
npm i react-native-multiple-choice --save
```

## Usage

Here is an overview of the component usage.

```jsx
alert(option + ' was selected!')}
/>
```

## Props

* `style - {}` custom style of the list
* `optionStyle - {}` custom style of the option element
* `options - []` required array of options
* `selectedOptions - []` optional array of initially selected options
* `maxSelectedOptions - int` optional maximum number of selectable options
* `onSelection - function(option){}` option selection callback
* `renderIndicator - function(option)` should return a selected/deselected indicator node, default: check mark image
* `renderSeparator - function(option)` should return a separator node that is displayed between the options, default: gray line
* `renderText - function(option)` should return a text node, default: text node
* `renderRow - function(option)` should return a option view
* `disabled - bool` if set to true component is disabled and can't be interacted with

## Screenshot

![example](https://raw.githubusercontent.com/d-a-n/react-native-multiple-choice/master/assets/images/screenshot.png)