New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-dropdown-select

Package Overview
Dependencies
Maintainers
1
Versions
120
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-dropdown-select

Customizable dropdown select for react

  • 1.2.6
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
22K
decreased by-42.46%
Maintainers
1
Weekly downloads
 
Created
Source

react-dropdown-select

Customisable dropdown select for react

Installation

npm install --save react-dropdown-select

Usage

import:

import Select from "react-dropdown-select";

and use as:

<Select
	placeholder="Select"
	addPlaceholder="+"
	multi={true}
	values={[options[0]]}
	options={options}
	onChange={(values) => this.setValues(values)}
	/>

Demo

Edit react-dropdown-select

Preview

https://sanusart.github.io/react-dropdown-select

PropsTypeDefaultDescription
Component props
valuesarray[]Selected values
optionsarray[]Available options
keepOpenboolfalseIf true, dropdown will always stay open (good for debugging)
dropdownGapnumber5Gap between select element and dropdown
multiboolfalseIf true - will act as multi-select, if false - only one option will be selected at the time
placeholderstring"Select..."Placeholder shown where there are no selected values
addPlaceholderstring"+"Secondary placeholder on search field if any value selected
disabledboolfalseDisable select and all interactions
styleobject{}style object to pass to sselect
classNamestringCSS class attribute to pass to sselect
loadingboolfalseloading indicator
clearablebooltrueClear all indicator
separatorbooltrueSeparator line between close all and dropdown handle
dropdownHandlebooltruedropdown handle to open/close dropdown
searchBystringlabelsearch by object property in values
labelFieldstring"label"field in data to use for label
valueFieldstring"value"field in data to use for value
closeOnScrollboolfalseIf true, scrolling the page will close the dropdown
Callback props
onChangefuncOn values change callback, returns array of values objects
onDropdownClosefuncfires upon dropdown close
onDropdownOpenfuncfires upon dropdown open
onClearAllfuncfires upon clearing all values (via custom renderers)
onSelectAllfuncfires upon selecting all values (via custom renderers)
contentRendererfuncOverrides internal content component (the contents of the select component)
itemRendererfuncOverrides internal item in a dropdown
noDataRendererfuncOverrides internal "no data" (shown where search has no results)
optionRendererfuncOverrides internal option (the pillow with an "x") on the select content
inputRendererfuncOverrides internal input text
loadingRendererfuncOverrides internal loading
clearRendererfuncOverrides internal clear button
separatorRendererfuncOverrides internal separator
dropdownRendererfuncOverrides internal dropdown component
dropdownHandleRendererfuncOverrides internal dropdown handle

Keywords

FAQs

Package last updated on 05 Jan 2019

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