All Projects → tableflip → react-native-select-multiple

tableflip / react-native-select-multiple

Licence: ISC license
☑️ A customiseable FlatList that allows you to select multiple rows

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to react-native-select-multiple

Vxe Table
🐬 vxe-table vue 表格解决方案
Stars: ✭ 4,242 (+2636.77%)
Mutual labels:  select, checkbox
bootstrap5-tags
Replace select[multiple] with nices badges for Bootstrap 5
Stars: ✭ 58 (-62.58%)
Mutual labels:  select, checkbox
Examples Win32
Shows how to use Win32 controls by programming code (c++17).
Stars: ✭ 22 (-85.81%)
Mutual labels:  checkbox, label
Prompt Checkbox
This repository has been archived, use Enquirer instead.
Stars: ✭ 21 (-86.45%)
Mutual labels:  select, checkbox
Cjlabel
A drop-in replacement for UILabel that supports NSAttributedString, rich text, display any view, links, select copy and more
Stars: ✭ 140 (-9.68%)
Mutual labels:  select, label
Teaset
A UI library for react native, provides 20+ pure JS(ES6) components, focusing on content display and action control.
Stars: ✭ 2,845 (+1735.48%)
Mutual labels:  select, checkbox
Formbase
Better default styles for common input elements.
Stars: ✭ 560 (+261.29%)
Mutual labels:  select, checkbox
Nb Choices
Angular wrapper for choices.js, vanilla, lightweight, configurable select box/text input plugin
Stars: ✭ 32 (-79.35%)
Mutual labels:  select, checkbox
Jhform
JhForm - 自定义表单工具,更加简单,快捷的创建表单、设置页面
Stars: ✭ 108 (-30.32%)
Mutual labels:  select, checkbox
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 (+15.48%)
Mutual labels:  select, checkbox
react-inputs-validation
A react component for form inputs validation. Online demo examples
Stars: ✭ 48 (-69.03%)
Mutual labels:  select, checkbox
pretty-checkbox-react
A tiny react/preact wrapper around pretty-checkbox
Stars: ✭ 35 (-77.42%)
Mutual labels:  checkbox
CustomWebCheckbox
An example of a make checkbox design on the web.
Stars: ✭ 12 (-92.26%)
Mutual labels:  checkbox
iOS-Frezzing-ANR-Detector
An ANR (Application Not Respond) or Freeze Detector for iOS. Using `select()`
Stars: ✭ 21 (-86.45%)
Mutual labels:  select
relect
A Tiny React Single Select Component.
Stars: ✭ 35 (-77.42%)
Mutual labels:  select
simple-switch
Vanilla JS/CSS Switch UI element
Stars: ✭ 18 (-88.39%)
Mutual labels:  checkbox
aarbac
An Automated Role Based Access Control .NET framework with T-SQL Query Parser which automatically parse select, insert, update, delete queries based on the logged in user role
Stars: ✭ 18 (-88.39%)
Mutual labels:  select
MaskedLabel
MaskedLabel is a UILabel subclass that allows you to easily apply a gradient to its text or to make it transparent.
Stars: ✭ 20 (-87.1%)
Mutual labels:  label
vue-bootstrap-select
A vue version of bootstrap select
Stars: ✭ 46 (-70.32%)
Mutual labels:  select
whaaaaat
Inquirer.js port to Python (https://www.npmjs.com/package/inquirer). people blame me for staling this project. I do not have time to work on this right now - whaaaaat do you want me to do? take it offline?
Stars: ✭ 73 (-52.9%)
Mutual labels:  checkbox

react-native-select-multiple

Build Status dependencies Status JavaScript Style Guide

A customiseable FlatList that allows you to select multiple rows.

select-multiple

Install

npm install react-native-select-multiple

Usage

import React, { Component } from 'react'
import { View } from 'react-native'
import SelectMultiple from 'react-native-select-multiple'

const fruits = ['Apples', 'Oranges', 'Pears']
// --- OR ---
// const fruits = [
//   { label: 'Apples', value: 'appls' },
//   { label: 'Oranges', value: 'orngs' },
//   { label: 'Pears', value: 'pears' }
// ]

class App extends Component {
  state = { selectedFruits: [] }

  onSelectionsChange = (selectedFruits) => {
    // selectedFruits is array of { label, value }
    this.setState({ selectedFruits })
  }

  render () {
    return (
      <View>
        <SelectMultiple
          items={fruits}
          selectedItems={this.state.selectedFruits}
          onSelectionsChange={this.onSelectionsChange} />
      </View>
    )
  }
}
export default App

Customize label

import React, { Component } from 'react'
import { View, Text, Image } from 'react-native'
import SelectMultiple from 'react-native-select-multiple'

const fruits = ['Apples', 'Oranges', 'Pears']
// --- OR ---
// const fruits = [
//   { label: 'Apples', value: 'appls' },
//   { label: 'Oranges', value: 'orngs' },
//   { label: 'Pears', value: 'pears' }
// ]

const renderLabel = (label, style) => {
  return (
    <View style={{flexDirection: 'row', alignItems: 'center'}}>
      <Image style={{width: 42, height: 42}} source={{uri: 'https://dummyimage.com/100x100/52c25a/fff&text=S'}} />
      <View style={{marginLeft: 10}}>
        <Text style={style}>{label}</Text>
      </View>
    </View>
  )
}

class App extends Component {
  state = { selectedFruits: [] }

  onSelectionsChange = (selectedFruits) => {
    // selectedFruits is array of { label, value }
    this.setState({ selectedFruits })
  }

  render () {
    return (
      <View>
        <SelectMultiple
          items={fruits}
          renderLabel={renderLabel}
          selectedItems={this.state.selectedFruits}
          onSelectionsChange={this.onSelectionsChange} />
      </View>
    )
  }
}

Properties

Prop Default Type Description
items - array All items available in the list (array of string or { label, value })
selectedItems [] array The currently selected items (array of string or { label, value })
onSelectionsChange - func Callback called when a user selects or de-selects an item, passed (selections, item)
keyExtractor index func keyExtractor for the FlatList
checkboxSource image object Image source for the checkbox (unchecked).
selectedCheckboxSource image object Image source for the checkbox (checked).
flatListProps {} object Additional props for the flat list
style default styles object Style for the FlatList container.
rowStyle default styles object Style for the row container.
checkboxStyle default styles object Style for the checkbox image.
labelStyle default styles object Style for the text label.
selectedRowStyle default styles object Style for the row container when selected.
selectedCheckboxStyle default styles object Style for the checkbox image when selected.
selectedLabelStyle default styles object Style for the text label when selected.
renderLabel null func Function for render label.
maxSelect null int Maximum number of selected items

Contribute

Feel free to dive in! Open an issue or submit PRs.

License

ISC © TABLEFLIP


A (╯°□°)╯︵TABLEFLIP side project.

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].