Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-multiple-select-dropdown-lite

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-multiple-select-dropdown-lite

React Multiple Select Light Weight Dropdown list | Searchable | Addable | Groupable etc

  • 2.0.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

React Multiple Select Dropdown Lite

A lightweight Multiple/Single Select Pure functional component for react using React-Hooks.

React Multiple Select Dropdown Lite is released under the MIT license. npm npm bundle size npm bundle size npm bundle size

Screenshot

react-multiple-select-dropdown-menu

Install

npm i react-multiple-select-dropdown-lite

Basic Initialization

import React, { useState } from 'react'
import MultiSelect from  'react-multiple-select-dropdown-lite'
import  'react-multiple-select-dropdown-lite/dist/index.css'

const App = () => {

  const [value, setvalue] = useState('')

  const  handleOnchange  =  val  => {
    setvalue(val)
  }

  const  options  = [
    { label:  'Option 1', value:  'option_1'  },
    { label:  'Option 2', value:  'option_2'  },
    { label:  'Option 3', value:  'option_3'  },
    { label:  'Option 4', value:  'option_4'  },
  ]

  return(
    <div className="app">
      <div  className="preview-values">
        <h4>Values</h4>
        {value}
      </div>

      <MultiSelect
        onChange={handleOnchange}
        options={options}
      />
    </div>
)}
export  default App

Features and Roadmap

  • JSON Value
  • Clearable
  • Disable Chip
  • Custom Down Arrow Icon
  • Disabled
  • Select Limit
  • Group
  • Searchable
  • Custom Creatable Value
  • Themeable (using css var)

Props Options

Propstypedefaultdescription
optionsarray""pass options as array of object
label : (string or JSX) Options Label
value : Option value
style : (object) custom style
classes : (string) style classes
title : must be provide for JSX label

example:
[ { label : "Option 1", value : "opt_1", style: {textAlign: 'center'}, classes: "classA classB" } ]
widthmove in css var (version 2.0.1)
namestring''specify a name for form
disabledboolfalsedisable input
defaultValuestring | array of object | string array''specify default value
jsonValueboolfalseget value from input as json
singleSelectboolfalseallow one select only
downArrowIconstring | icon | componentSVGSpecify custom down arrow icon
closeIconstring | icon | componentSVGSpecify custom close arrow icon
clearablebooltrueshow / hide close icon to clear value
downArrowbooltrueshow / hide down icon in dropdown
classNamestring | objectspecify custom class
placeholderstringSelect...Input Placeholder
disableChipboolfalsedisable multiple select chips show value or total selected value only
attrobjectset custom attr to element
customValueboolfalsecreate custom options by pressing enter or comma (,)
largeDataboolfalseprevent slow down (DOM) for large amount of data
chipAlternateTextstring(number) Item SelectedShow text when chip disabled.
closeOnSelectbooltrueclose option-menu on select option

Events

PropsParamsDescription
onChangevaluesTrigger on change any value
onMenuOpennullTrigger when menu open
onMenuClosenullTrigger when menu close

CSS Variables

CSS variable applied in .msl-vars class name.

VariableDefault ValueDetails
--menu-max-height400pxDropdown menu
maximum height.
--input-width300pxDropdown input width.
--font-size16pxDropdown font size.
--border-radius8px 8px 8px 8pxDropdown Border Radius.
--active-menu-shadow1px 1px 5px 0px grayMenu Shadow
when active.
--line-height1.4fonts line height.
--active-menu-backgroundwhiteDropdown menu
background color when active.
--active-menu-radiusvar(--border-radius)Dropdown menu border
radius when active.

Change Log

v-2.0.4
  • CSS variables updated
v-2.0.1
  • Provide component width in css vars intead of props
  • Menu rise up at page bottom
  • events added on menu open/close
v-2.0.0
  • React component support as label
  • Search feature improved
  • Custom values grouped
  • Single Select Bug fixed



Sponsor

License

MIT © Arif-Un | Amin | Built for Bit Form

Keywords

FAQs

Package last updated on 22 Aug 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc