Coder Social home page Coder Social logo

jljlpch / react-native-multiple-choice Goto Github PK

View Code? Open in Web Editor NEW

This project forked from d-a-n/react-native-multiple-choice

0.0 2.0 0.0 142 KB

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

License: MIT License

JavaScript 54.08% Java 7.77% Objective-C 38.15%

react-native-multiple-choice's Introduction

react-native-multiple-choice

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

Install

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

Usage

Here is an overview of the component usage.

<MultipleChoice
    options={[
    'Lorem ipsum dolor sit',
    'Lorem ipsum',
    'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.',
    'Lorem ipsum dolor sit amet, consetetur',
    'Lorem ipsum dolor'
    ]}
    selectedOptions={['Lorem ipsum']}
    maxSelectedOptions={2}
    onSelection={(option)=>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

react-native-multiple-choice's People

Contributors

d-a-n avatar yannickoo avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.