Huge News!Announcing our $40M Series B led by Abstract Ventures.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.4.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
33K
increased by119.15%
Maintainers
1
Weekly downloads
 
Created
Source

react-dropdown-select

Customisable dropdown select for react

Coverage Status Build Status

Installation

npm install --save react-dropdown-select

Usage

import:

import Select from "react-dropdown-select";

and use as:

<Select options={options} onChange={(values) => this.setValues(values)} />

options and onChange are the minimum requered props

Demo

Edit react-dropdown-select

Preview

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

PropsTypeDefaultDescription
Component props
valuesarray[]Selected values
optionsarray[]Available options, (option with key disabled: true will be disabled)
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
dropdownHeightstring"300px"min-height of a 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
colorstring"#0074D9"base color to use in component, also can be overwritten via CSS
closeOnScrollboolfalseIf true, scrolling the page will close the dropdown
closeOnSelectboolfalseIf true, selecting option will close the dropdown
openOnTopboolfalseIf true, dropdown will open on top of the select
keepSelectedInListbooltrueIf false, selected item will not appear in a list
portalDOM elementfalseIf valid dom element specified - dropdown will break out to render inside the specified element
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 11 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