Renders the Picker/SelectBox/Dropdown with common styling for iOS/Android

Renders the Picker/SelectBox/Dropdown with common styling for iOS/Android

Platform independent (Android / iOS) Selextbox | Picker | Multi-select | Multi-picker. The idea is to bring out the common user-interface & user-experience on both platforms.

react-native-multi-selectbox

Platform independent (Android / iOS) Selextbox | Picker | Multi-select | Multi-picker. The idea is to bring out the common user-interface & user-experience on both platforms.

demo

Getting started

How to install 🎹

npm install react-native-multi-selectbox

or

yarn add react-native-multi-selectbox

Usage 𖣠

import React, { useState } from 'react'
import { Text, View } from 'react-native'
import SelectBox from 'react-native-multi-selectbox'
import { xorBy } from 'lodash'
// Options data must contain 'item' & 'id' keys
const K_OPTIONS = [
  {
    item: 'Juventus',
    id: 'JUVE'
  },
  {
    item: 'Real Madrid',
    id: 'RM'
  },
  {
    item: 'Barcelona',
    id: 'BR'
  },
  {
    item: 'PSG',
    id: 'PSG'
  },
  {
    item: 'FC Bayern Munich',
    id: 'FBM'
  },
  {
    item: 'Manchester United FC',
    id: 'MUN'
  },
  {
    item: 'Manchester City FC',
    id: 'MCI'
  },
  {
    item: 'Everton FC',
    id: 'EVE'
  },
  {
    item: 'Tottenham Hotspur FC',
    id: 'TOT'
  },
  {
    item: 'Chelsea FC',
    id: 'CHE'
  },
  {
    item: 'Liverpool FC',
    id: 'LIV'
  },
  {
    item: 'Arsenal FC',
    id: 'ARS'
  },
  {
    item: 'Leicester City FC',
    id: 'LEI'
  }
]
function App() {
  const [selectedLocations, setSelectedLocations] = useState({})
  const [selectedValues, setSelectedValues] = useState([])
  return (
    <View style={{ margin: 30 }}>
      <View style={{ width: '100%', alignItems: 'center' }}>
        <Text style={{ fontSize: 30, paddingBottom: 20 }}>Demos</Text>
      </View>
      <Text style={{ fontSize: 20, paddingBottom: 10 }}>Select Demo</Text>
      <SelectBox
        label="Select single"
        options={K_OPTIONS}
        value={selectedLocations}
        onChange={onChange()}
        hideInputFilter={false}
      />
      <View style={{ height: 40 }} />
      <Text style={{ fontSize: 20, paddingBottom: 10 }}>MultiSelect Demo</Text>
      <SelectBox
        label="Select multiple"
        options={K_OPTIONS}
        selectedValues={selectedValues}
        onMultiSelect={onMultiChange()}
        onTapClose={onMultiChange()}
        isMulti
      />
    </View>
  )
  function onMultiChange() {
    return item => setSelectedValues(xorBy(selectedValues, [item], 'id'))
  }
  function onChange() {
    return val => setSelectedLocations(val)
  }
}
export default App
Prop Type Default Value
label String Label
inputPlaceholder string Label
width string "100%"
viewMargin string "0px"
isMulti boolean false
hideInputFilter boolean true
selectedValues array []
value array []
selectIcon component <Icon name={'downArrow'} />
labelStyle style object Default style
containerStyle style object Default style
inputFilterContainerStyle style object Default style
inputFilterStyle style object Default style
optionsLabelStyle style object Default style
optionContainerStyle style object Default style
multiOptionContainerStyle style object Default style
multiOptionsLabelStyle style object Default style
multiListEmptyLabelStyle style object Default style
listEmptyLabelStyle style object Default style
selectedItemStyle style object Default style
options array [{ item: 'Juventus', id: 'JUVE'},{ item: 'Real Madrid', id: 'RM'},{ item: 'Barcelona', id: 'BR'},{ item: 'PSG', id: 'PSG'},{ item: 'FC Bayern Munich', id: 'FBM'}]

Want to be a contributor? 👷🏼‍♂️👷🏼‍♀️

Check-in develop branch and submit a new pull-request

Issues or feature request? ✍🏼

You can submit a request on https://github.com/sauzy34/react-native-multi-selectbox/issues

Support & Share 💆🏼‍♂️

Please star the repository on Github to enhance the reach to more developers.

Download Details:

Author: sauzy34

Source Code: https://github.com/sauzy34/react-native-multi-selectbox

react react-native mobile-apps

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

How native is React Native? | React Native vs Native App Development

Article covers: How native is react native?, React Native vs (Ionic, Cordova), Similarities and difference between React Native and Native App Development.

React Native Mobile App Development

Skenix is providing React Native Development Services with qualified React Native App Developers. Get the best React Native App Development Services.

How React Native Is Shaping Mobile App Development

Are you a mobile app developer looking for more efficient tools for your projects? Mobile app development is getting tougher and tougher as the market continues to grow. As a developer, you need to develop Apps which meet the demands of your users. To achieve this, adopt the right tools, like the React Native development framework.

Top React Native Mobile App Development Companies in USA

Looking for top React Native mobile app development company in USA for Startups & Enterprise? Find out the top list of React Native mobile app development company in USA.

Which is the best React Native app development company in New York?

Hire top react native app development company in New York to build and develop custom react native mobile apps for Android & iOS with the latest features.