6.12.108 • Published 10 months ago

@patrtorg/laborum-perspiciatis v6.12.108

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

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

PropDefaultTypeDescription
items-arrayAll items available in the list (array of string or { label, value })
selectedItems[]arrayThe currently selected items (array of string or { label, value })
onSelectionsChange-funcCallback called when a user selects or de-selects an item, passed (selections, item)
keyExtractorindexfunckeyExtractor for the FlatList
checkboxSourceimageobjectImage source for the checkbox (unchecked).
selectedCheckboxSourceimageobjectImage source for the checkbox (checked).
flatListProps{}objectAdditional props for the flat list
styledefault stylesobjectStyle for the FlatList container.
rowStyledefault stylesobjectStyle for the row container.
checkboxStyledefault stylesobjectStyle for the checkbox image.
labelStyledefault stylesobjectStyle for the text label.
selectedRowStyledefault stylesobjectStyle for the row container when selected.
selectedCheckboxStyledefault stylesobjectStyle for the checkbox image when selected.
selectedLabelStyledefault stylesobjectStyle for the text label when selected.
renderLabelnullfuncFunction for render label.
maxSelectnullintMaximum number of selected items

Contribute

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

License

ISC © TABLEFLIP


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

positivepreprocessorreduceisConcatSpreadableoptimizerObservablescopyfunctionalgetintrinsicnegativesuperstructfantasy-landmake dirwindowpackagecallpyyamltyped arrayprefixharmonycommand-linehttpsObject.entriessortfpUint8ClampedArraynativeletidplugin[[Prototype]]awssubprocesspropsource mapgdprArrayBufferES2020binMapfindupCSSelbkarmaObservableroutingdrophttpignorepnpm9css-in-jses-abstractcomputed-typesjstrimEndobjglobal this valuetransporteslintserializationAsyncIteratorjapanese256Array.prototype.includeschromesqscoerciblepromisetacitmapreduceebsECMAScript 6call-bindtypedarrayRegExp#flagsloggerextendes2015WeakSettesterrmdirfast-clonetypanionenumerablecreatebindprotoeverybrowserlistindicatorArrayBuffer#sliceanimationsearchincludesspawnfindformatFunction.prototype.namearktypeminimalvalidatorlintyupcore-jsserializeratominferencejestparserutilslengthintrinsicstreamcallbindgroupreadableendermanagergetopttypeerrorreaddragcsscoveragepackage.jsondom-testing-libraryespolyfillemojiboundES2021iteraterulesreadablestreamUint32ArraybyteLengthquotetc39glacierhas-ownlanguagearraybuffertapmkdirpdebugfindLastIndexECMAScript 2019censorhasforkvisualsuperagentgraphqldeletees-shim APIdescriptorvarescapesameValueZerojavascripturlrangeerrorprunesimpledbshebangframeworkfnmatchinspectschemeReflect.getPrototypeOfbddES8hardlinksrm -rfES2015ECMAScript 2016fast-deep-copyregexassertsfile systemajaxprotocol-buffersl10nregexp.gitignoretaperfc4122monorepovalidatetranspilermxhrreverseoutputes5storagegatewayasterisksclientinstallerdeepcopyassertiondebuggerECMAScript 2020symbolsconcatECMAScript 2015lastfull-widthdeepcloneInt32ArrayECMAScript 2017requirerestsesstyled-componentswaapicontainsreal-timetrimStartcompileraccessorUint8Arrayprocesspipedomregularsymlinkstypeofuser-streamstoSortedjoii18ntoobjectreact-hook-formsloteslintpluginInt8ArrayramdareuseArrayBuffer.prototype.slicebinarieses2017identifiersArrayreducerimportexportselfbyteObject.valuescurriedrobustclass-validatorTypeBoxjson-schema-validatorfixed-widthES2017ObjectspecphoneapolloinvariantObject.keysfunctionsnstelephonedotenvttypostcssjsonschemaweakmaplookamazonclassnamespeedmoveeventses2016parentstringvpcwafexpressiontestmanipulationtermviewjasminereact poseoptimiststyleCSSStyleDeclarationTypedArrayutilitiescloudsearchperformanttslibisESwgetexecfileES2019mkdir-0posegroupByiechromiumvalidfigletshamregular expressionES6look-upappoffsettakematchesfetchhigher-orderES2018flagrdsrapidsetbundlerObject.getPrototypeOfenvfast-deep-cloneoncecloudfronteventDispatcherapiStreamstarterspringcloudwatchaccessibilitycjkcolumnhelperJSON-SchemaArray.prototype.flatMapPromiseSetbabelECMAScriptnumberespreeYAMLexeca11yfindLastjson-schemaregular-expressionjsdiffefficientECMAScript 7BigUint64ArraycommandermkdirsglobWebSocketcollectionbinarycall-boundUint16Arraywhatwgiamcharactershooksxmldeep-copydateinputtoolstraversebusyindirworkerloadbalancingprogressvariablesredactforEachBigInt64Arrayagentinstallcloudtrailshelljsx_.extendpropertiesclassnamescacheJSONairbnbdefineistanbul@@toStringTagtsgetterloggingartpinoconstwidthquerystringconsoleES2022Object.definePropertyhasOwndescriptionpackage managerWebSocketsgenericsdescriptorsec2keychecktypedarrays$.extendlocalnpmignorewebargvreduxclirestfuleslint-pluginprotobufjsonWeakMaploadinginternalECMAScript 2022endpointflattenkoreansafeprivatecolourparsetranspilerhelperslistenersdeterministicfastcloneassertgesturesglobalyamltrimidleasttypedequalitystructuredClonecallbacktestingstyleguideenvironmentsform-validationwritableObject.assignfullwidthqueueMicrotasktypesargsprettynopehasOwnPropertySymbolkinesisstringifyrequestwalkingbufferremoveentriesdependenciesObject.fromEntries.envreworkmatchclassescollection.es6__proto__byteOffsetcurlRxsetPrototypeOfbannerdataviewwalkTypeScriptStreamsimportrandomlibphonenumberECMAScript 3deepvalidationupsharedfind-upio-tsreactexecutecloneSymbol.toStringTagsymbolfastString.prototype.matchAlldefinePropertyasciitoArrayArray.prototype.containses6multi-packagebabel-coreroute53Float64ArrayECMAScript 5beanstalkjQueryfastifysideownvaluestypebrowsercolorestreesetterchinesesyntaxbrowserslistweaksetextraparentscharacterreact-hooksUnderscoreURLSearchParamstimepoint-freelinkglobalThisdayjsInt16Arraycode pointsfastcopypureframerschemaObject.isgitignoretoReversedArray.prototype.findLastIndexscheme-validationqueuehashmochaajvreact animationcolors6to5npmsinatrabundlingwhichES5swfsyntaxerrortrimRightomitstringifiercallboundtouchtddpackagesdirectorycoreuuidunicodeHyBiarrayassigndependency managerresolvequeryString.prototype.trimmoduleswriteECMAScript 2023modulehookformsortedrgbpatchutilitySystem.globalenvironmentcircularReactiveXequalconcatMapvestautoprefixerponyfillpropertyutil.inspectjsdomthreevaluenodejsrouteroutermomentflatMapfast-copystreamsawesomesaucepushcommandIteratorvarsnegative zeronamesemitlruexpressmakeqsmatchAllsettingsimmerfromMicrosoftformstypesafeperformanceECMAScript 2018toStringTagnodeformattingstylingrssimmutableeslintconfig3d
6.12.108

10 months ago

6.12.106

10 months ago

6.12.107

10 months ago

6.12.105

10 months ago

6.12.104

10 months ago

6.12.103

10 months ago

6.12.102

10 months ago

6.12.101

10 months ago

5.12.101

10 months ago

5.11.101

10 months ago

5.11.100

10 months ago

5.11.99

10 months ago

5.11.98

10 months ago

5.11.97

10 months ago

5.11.96

10 months ago

5.11.95

10 months ago

5.11.94

10 months ago

5.11.93

10 months ago

5.11.92

10 months ago

5.11.91

10 months ago

5.11.90

10 months ago

5.11.89

11 months ago

5.10.89

11 months ago

5.10.88

11 months ago

5.10.87

11 months ago

5.10.86

11 months ago

4.10.86

11 months ago

4.10.85

11 months ago

4.10.84

11 months ago

4.10.83

11 months ago

4.10.82

11 months ago

4.10.81

11 months ago

4.10.80

11 months ago

4.10.79

11 months ago

4.9.79

11 months ago

4.9.78

11 months ago

4.8.78

11 months ago

4.8.77

11 months ago

4.8.76

11 months ago

4.8.75

11 months ago

4.8.74

11 months ago

4.8.73

11 months ago

4.8.72

11 months ago

4.8.71

11 months ago

4.8.70

11 months ago

4.8.69

11 months ago

3.8.69

11 months ago

3.8.68

11 months ago

3.8.67

11 months ago

3.8.66

11 months ago

3.8.65

11 months ago

3.7.65

12 months ago

3.7.64

12 months ago

3.7.63

12 months ago

3.7.62

12 months ago

3.6.62

12 months ago

3.6.61

12 months ago

3.6.60

12 months ago

3.6.59

12 months ago

3.6.58

12 months ago

3.6.57

12 months ago

3.6.56

12 months ago

3.6.55

12 months ago

3.6.54

12 months ago

3.6.53

12 months ago

3.5.53

12 months ago

3.5.52

12 months ago

3.5.51

12 months ago

3.4.51

12 months ago

3.4.50

12 months ago

3.4.49

12 months ago

3.4.48

1 year ago

3.4.47

1 year ago

3.4.46

1 year ago

3.4.45

1 year ago

3.4.44

1 year ago

3.4.43

1 year ago

3.4.42

1 year ago

3.4.41

1 year ago

3.4.40

1 year ago

3.4.39

1 year ago

3.4.38

1 year ago

3.4.37

1 year ago

3.4.36

1 year ago

3.4.35

1 year ago

3.4.34

1 year ago

3.4.33

1 year ago

3.4.32

1 year ago

3.4.31

1 year ago

3.3.31

1 year ago

3.3.30

1 year ago

3.3.29

1 year ago

3.3.28

1 year ago

3.3.27

1 year ago

3.3.26

1 year ago

3.3.25

1 year ago

3.2.25

1 year ago

3.2.24

1 year ago

3.2.23

1 year ago

3.2.22

1 year ago

3.1.22

1 year ago

3.1.21

1 year ago

3.1.20

1 year ago

3.1.19

1 year ago

2.1.19

1 year ago

2.1.18

1 year ago

2.1.17

1 year ago

2.1.16

1 year ago

2.1.15

1 year ago

2.1.14

1 year ago

2.1.13

1 year ago

2.1.12

1 year ago

2.1.11

1 year ago

2.1.10

1 year ago

2.1.9

1 year ago

1.1.9

1 year ago

1.1.8

1 year ago

1.1.7

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago