1.0.7 • Published 2 years ago

rr-multi-select v1.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Multiple Select React Component

Multiple select React component with "type to search" feature. It can handle thousands of data (up to 5000 records) synchronously with minimum latency.

There are cool & amazing packages out there, but I found it laggy when handling thousands of data synchronously. So I made this for my needs.

Hope it can be useful too for your needs.

Install

Install using: yarn add rr-multi-select or npm install rr-multi-select

Usage

1. Simple array
import React, {useState} from 'react'
import RRMultiSelect from 'rr-multi-select'

const options = [
  "Data 1",
  "Data 2",
  "Data 3"
]

const FormBlock = () => {

  const [value,setValue] = useState([])

  return (
    <RRMultiSelect
      options={options}
      value={value}
      onChange={setValue}
    />
  )
}
export default FormBlock
2. Array of objects
import React, {useState} from 'react'
import RRMultiSelect from 'rr-multi-select'

const options = [
  {value:"data1",label:"Data 1"},
  {value:"data2",label:"Data 2"},
  {value:"data3",label:"Data 3"}
]

const FormBlock = () => {

  const [value,setValue] = useState([])

  return (
    <RRMultiSelect
      options={options}
      isObject={["value","label"]}
      value={value}
      onChange={setValue}
    />
  )
}
export default FormBlock

Props

NameDescription
optionsArray
isObjectArray ie. "value","label"
valueArray
placeholderTextString ie. "Select..."
inputPlaceholderString ie. "Type to search..."
onChangeFunction
1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago