All Projects → danceyoung → React Native Selectmultiple Button

danceyoung / React Native Selectmultiple Button

Licence: mit
A button (or a grouped buttons) supporting multiple or radio selection by building with React Native. https://github.com/danceyoung/selectmultiplebuttons for Swift.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to React Native Selectmultiple Button

tagselector
Dependency-free JS library that turns select fields in customizable tag clouds
Stars: ✭ 19 (-73.61%)
Mutual labels:  select, multiple
Flutter smart select
SmartSelect allows you to easily convert your usual form select or dropdown into dynamic page, popup dialog, or sliding bottom sheet with various choices input such as radio, checkbox, switch, chips, or even custom input. Supports single and multiple choice.
Stars: ✭ 179 (+148.61%)
Mutual labels:  radio, select
React Native Dropdown Picker
A single / multiple, categorizable & searchable item picker (dropdown) component for react native which supports both Android & iOS.
Stars: ✭ 230 (+219.44%)
Mutual labels:  select, multiple
Angular Chosen
AngularJS Chosen directive is an AngularJS Directive that brings the Chosen jQuery in a AngularJS way
Stars: ✭ 695 (+865.28%)
Mutual labels:  select, multiple
AMChoice
Radio Button and check box for iOS
Stars: ✭ 45 (-37.5%)
Mutual labels:  radio, button
react-native-animated-radio-button
Fully customizable animated radio button for React Native
Stars: ✭ 25 (-65.28%)
Mutual labels:  radio, button
Heyui
🎉UI Toolkit for Web, Vue2.0 http://www.heyui.top
Stars: ✭ 2,373 (+3195.83%)
Mutual labels:  button, select
react-native-radio-buttons-group
Simple, best and easy to use radio buttons for react native apps.
Stars: ✭ 145 (+101.39%)
Mutual labels:  radio, button
Vxe Table
🐬 vxe-table vue 表格解决方案
Stars: ✭ 4,242 (+5791.67%)
Mutual labels:  radio, select
Prompt Checkbox
This repository has been archived, use Enquirer instead.
Stars: ✭ 21 (-70.83%)
Mutual labels:  radio, select
Ngx Tree Select
Angular select component with tree items
Stars: ✭ 59 (-18.06%)
Mutual labels:  select
Ember Select Box
🔠 A faux select box for Ember apps
Stars: ✭ 60 (-16.67%)
Mutual labels:  select
Transitionbutton
UIButton sublass for loading and transition animation.
Stars: ✭ 1,124 (+1461.11%)
Mutual labels:  button
Floating Navigation View
A simple Floating Action Button that shows an anchored Navigation View
Stars: ✭ 1,169 (+1523.61%)
Mutual labels:  button
Airspy Fmradion
Software decoder for FM/AM broadcast radio with AirSpy R2 / Mini, Airspy HF+, and RTL-SDR
Stars: ✭ 59 (-18.06%)
Mutual labels:  radio
Fitbutton
The button which can use with icon, text, divider, custom ripple effect, border, corner radius e.t.c.
Stars: ✭ 63 (-12.5%)
Mutual labels:  button
React Native Modal Dropdown
A react-native dropdown/picker/selector component for both Android & iOS.
Stars: ✭ 1,103 (+1431.94%)
Mutual labels:  select
Rfsec Toolkit
RFSec-ToolKit is a collection of Radio Frequency Communication Protocol Hacktools.无线通信协议相关的工具集,可借助SDR硬件+相关工具对无线通信进行研究。Collect with ♥ by HackSmith
Stars: ✭ 1,085 (+1406.94%)
Mutual labels:  radio
Ripple Without Js
Create Material Design ripple effect in your HTML without using a single line of JS.
Stars: ✭ 53 (-26.39%)
Mutual labels:  button
Vue Progress Button
Animated button for VueJS
Stars: ✭ 71 (-1.39%)
Mutual labels:  button

React Native SelectMultiple Button

This library is a button (or a grouped buttons) supporting multiple or radio selection by building with React Native. https://github.com/danceyoung/selectmultiplebuttons for Swift.

You can specify any Layout and Style for container view,button view and text through View Style Props, Layout Props and Text Style Props supporting by React Native

Example running in iOS and Android(captured by GIPHY CAPTURE)

captured by GIPHY CAPTURE

Note:Runing a Android Virtual Device is TMDing too large memory eated.

Instruction

  • SelectMultipleButton

  • SelectMultipleGroupButton

SelectMultipleButton

You need to set the props selected as true to highlight button's selected status and manage the data selected through event props singleTap(valueTap) by hard coding yourself.

SelectMultipleGroupButton

You needn't to set these settings like SelectMultipleButton, because these features are build in the SelectMultipleGroupButton. What you do is set the event props singleTap(valueTap) to hold the value tap and the event props onSelectedValuesChange(selectedValues) to hold the array of values selected.

Installation

cd your project root direction

$ npm install react-native-selectmultiple-button --save

Usage

code example

App.js

code snap

import {
  SelectMultipleButton,
  SelectMultipleGroupButton
} from "react-native-selectmultiple-button";

<SelectMultipleButton
  buttonViewStyle={{
    borderRadius: 10,

    height: 40
  }}
  textStyle={{
    fontSize: 15
  }}
  highLightStyle={{
    borderColor: "gray",

    backgroundColor: "transparent",

    textColor: "gray",

    borderTintColor: ios_blue,

    backgroundTintColor: ios_blue,

    textTintColor: "white"
  }}
  multiple={true}
  value={interest}
  selected={this.state.multipleSelectedData.includes(interest)}
  singleTap={valueTap => this._singleTapMultipleSelectedButtons(interest)}
/>;

<SelectMultipleGroupButton
  containerViewStyle={{
    justifyContent: "flex-start"
  }}
  highLightStyle={{
    borderColor: "gray",

    backgroundColor: "transparent",

    textColor: "gray",

    borderTintColor: ios_blue,

    backgroundTintColor: "transparent",

    textTintColor: ios_blue
  }}
  onSelectedValuesChange={selectedValues =>
    this._groupButtonOnSelectedValuesChange(selectedValues)
  }
  group={multipleGroupData}
/>;

Props

SelectMultipleButton

props type required desc
selected bool no Default is false. The selected prop determines whether the button is selected and highlighted
value one of types(string,number) yes Your business key
displayValue one of types(string,number) no Default is == value prop if not set displayValue prop. Displayed as button's text
singleTap function(valueTap) no Handler to be called when the user taps the button. The button's props value is passed as an argument to the callback handler

highLightStyle

Normal or highlighted style, the style object {} contains the following keys.

  • borderColor: PropTypes.string.isRequired---Normal color of button border.

  • backgroundColor: PropTypes.string.isRequired---Normal color of button background.

  • textColor: PropTypes.string.isRequired---Normal color of text.

  • borderTintColor: PropTypes.string.isRequired---Highlighted color of button border.

  • backgroundTintColor: PropTypes.string.isRequired---Highlighted color of button background.

  • textTintColor: PropTypes.string.isRequired--Highlighted color of text.

Default style is

{

borderColor: 'gray',

backgroundColor: 'transparent',

textColor: 'gray',

borderTintColor: ios_blue,

backgroundTintColor: 'transparent',

textTintColor: ios_blue,

}


buttonViewStyle

Style of button view. You can specify any View Style Props.

Default style is

{
  margin: 5,
  borderRadius: 3,
  alignItems: 'center',
  justifyContent: 'center',
  borderWidth: 1
}

textStyle

Style of text. You can specify any Text Style Props

Default style is

{
  textAlign: 'center',
  marginTop: 5,
  marginBottom: 5,
  marginLeft: 10,
  marginRight: 10,
}

SelectMultipleGroupButton

props type required desc
multiple bool no Default is true. The multiple prop determines the grouped buttons are multiple or radio selected
defaultSelectedIndexes array no The indexes array in group of the grouped buttons to be default selected and highlighted
maximumNumberSelected number no Specifies maximum number for selecting buttons, and its smallest value is 2. Only enabled for multiple prop is set true
group array of {value,displayValue} yes Just a plain array, value and displayValue props are akin to value and displayValue props of SelectMultipleButton.
singleTap function(valueTap) no Handler to be called when the user taps the button. The button's props value is passed as an argument to the callback handler.
onSelectedValuesChange function(selectedValues) no Handler to be called when the user taps the button.the array of selected values is passed as an argument to the callback handler.

highLightStyle

Normal or highlighted style, akin to highLightStyle of SelectMultipleButton.


buttonViewStyle

Style of button view, akin to buttonViewStyle of SelectMultipleButton.


textStyle

Style of text, akin to textStyle of SelectMultipleButton.


containerViewStyle

Style of the grouped buttons container view. You can specify any View Style Props and Layout Props.

Default View Style and Layout props is

{
  flexWrap: 'wrap',
  flexDirection: 'row',
  justifyContent: 'center'
}

License

react-native-selectmultiple-button is MIT Licensed.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].