Customizable React Dropdown Component
Totally customizable and light weight dropdown for react component.
npm install customizable-dropdown-react
yarn add customizable-dropdown-react
import Dropdown "customizable-dropdown-react";
<Dropdown
list="list of the items for the drop"
callback={this.callback_func}
/>
Props | Expected values | ||
---|---|---|---|
list |
This prop can accept two types of data, i.e
|
||
multiselect |
Booleantrue: will enable the feature to multi select the items from the dropdown. by default the value is false. |
||
focus |
FunctionPass the callback function on focus event of the component |
||
keydown |
FunctionPass the callback function on keydown event of the component |
||
callback |
FunctionReturns input field value on every input change |
||
autofocus |
BooleanWill focus the dropdown input on mounting. Default value: false |
||
disabled |
BooleanWill disable the input. Default value: false |
||
async |
BooleanWill enable asynchronous loading of lists. Default value: false Note: Asynchronous loading will work by default also, but some functionality wouldn't work. |
||
placeholder |
string |
||
containerClass |
classNameCustomize the style of the dropdown by passing custom class |
||
inputClass |
classNameCustomize the style of the input field of the component by passing custom class |
||
listClass |
classNameCustomize the style of the dropdown list of the component by passing custom class |
||
loadingText |
stringProvide custom loading text for async loading |
||
loadingClass |
stringCustomize the style of the loading component by passing custom class. |
The response for all the functional props i.e focus, keydown, callback is:
{ currentInput: '', // current input of the component event, // corresponding event multiSelect: [], // array of inputs. Present only if the prop multiselect is true }