1.1.10 • Published 2 years ago

toey-react-dropdown v1.1.10

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

react-searchable-dropdown 1.0.5

How to install

# NPM
npm i the-ultimate-and-the-best-react-searchable-dropdown

#YARN
yarn add the-ultimate-and-the-best-react-searchable-dropdown

Story Book Demo

https://613c0ae26a019e003a9d89ed-hpjlfbrniz.chromatic.com/

Component Info

There are MultipleSelector and Selector dropdown component, both are handle long list of choices by using lib react-window (https://github.com/bvaughn/react-window) and using style and component from material-ui (https://material-ui.com/)

Selector Info

Selector Special Type

type nametypeDescription
Choice{ label: string; used?: boolean; description?: string; key: string: any; }choice object that we provide to the selector, choice must have label and you can add any arbitary attribute to it so it will return when the choice is selected, description is a string showing on choice tooltip
ChoiceSection{ choices: Choice[]; sectionName?: string; sectionPrefix?: any; }contain section name, section prefix and choices of that section
SearchTextFieldPropsTextFieldProps (from material-ui)search textfield props type, it is exported from Selector component
SearchTextFieldInputPropsPartial\<InputProps> | Partial\<FilledInputProps> | Partial\<OutlinedInputProps> (all from material-ui)search textfield input props type, it is exported from Selector component

Selector Required Props

nametypeDescription
labelstringstring label showing on selector div
popUpKeystringkey for selector popup element
choiceSectionsChoiceSection[]key for selector popup element
handleSelect({ value, name }: { value: Choice, name: string }) => voidhandle function, trigger when a choice is selected

Selector Optional Props

nametypeDescription
itemHeightnumberheight of item inside popup (for react-window component)
scrollDivHeightnumberheight of popup scroll div (for react-window component)
styleCSSPropertiesHTML style props for top div component that have every other component inside
selectDivPropsStyleCSSPropertiesHTML style props for button component that handle click event
classNamestringclassName for button component that handle click event
labelPrefixstringstring that will show on the left side of the selector label
namestringname of the selector that will also provide to handleSelect function
placeholderstringplaceholder will show when label is null, undefined or empty string
idstringid for selector that will provide to all inside component
tooltipstringstring that will show on selector tooltip
topDivClassNamestringclassName props for top div component that have every other component inside
popupClassNamestringselector popup className props
sectionNameClassNamestringpopup section name component className props
itemClassNamestringitem className props
disablePortalbooleanfor disable popup portal
errorbooleanif error selector will have red border
disablebooleanfor disable the selector
disableDropDownArrowbooleanfor hiding arror
dropDownArrowClassNamestringarrow component className
dropDownArrowComponentReact.ReactNodefor custom dropdown arrow
searchTextfieldPropsSearchTextFieldPropsprops object for search textfield
searchTextFieldInputPropsSearchTextFieldInputPropsinput props object for search textfield

Multiple Selector Info

Multiple Selector Special Type

type nametypeDescription
Choice{ label: string; used?: boolean; checked?: boolean; singleChoice?: boolean; id?: string; key: string: any; }choice object that we provide to the selector, choice must have label and you can add any arbitary attribute to it so it will return when the choice is selected, if singleChoice is true handleSelect will trigger when click on this choice
ChoiceSection{ choices: Choice[]; sectionName?: string; sectionPrefix?: any; }contain section name, section prefix and choices of that section
SearchTextFieldPropsTextFieldProps (from material-ui)search textfield props type, it is exported from Selector component
SearchTextFieldInputPropsPartial\<InputProps> | Partial\<FilledInputProps> | Partial\<OutlinedInputProps> (all from material-ui)search textfield input props type, it is exported from Selector component

Multiple Selector Required Props

nametypeDescription
labelstringstring label showing on selector div
popUpKeystringkey for selector popup element
choiceSectionsChoiceSection[]key for selector popup element
handleSelect({ value, name }: { value: Choice[], name: string }) => voidhandle function, trigger when a sigleChoice choice is click or popup is close

Multiple Selector Optional Props

nametypeDescription
itemHeightnumberheight of item inside popup (for react-window component)
scrollDivHeightnumberheight of popup scroll div (for react-window component)
styleCSSPropertiesHTML style props for top div component that have every other component inside
selectDivPropsStyleCSSPropertiesHTML style props for button component that handle click event
classNamestringclassName for button component that handle click event
labelPrefixstringstring that will show on the left side of the selector label
namestringname of the selector that will also provide to handleSelect function
placeholderstringplaceholder will show when label is null, undefined or empty string
idstringid for selector that will provide to all inside component
tooltipstringstring that will show on selector tooltip
topDivClassNamestringclassName props for top div component that have every other component inside
popupClassNamestringselector popup className props
sectionNameClassNamestringpopup section name component className props
itemClassNamestringitem className props
checkedChoicesChoice[]lish that contain all check choice, if provide choices that are in checkedChoices will be checked when open popup
errorbooleanif error selector will have red border
disablebooleanfor disable the selector
disableDropDownArrowbooleanfor hiding arror
dropDownArrowClassNamestringarrow component className
dropDownArrowComponentReact.ReactNodefor custom dropdown arrow
searchTextfieldPropsSearchTextFieldPropsprops object for search textfield
searchTextFieldInputPropsSearchTextFieldInputPropsinput props object for search textfield
1.1.10

2 years ago

1.1.9

2 years ago

1.1.8

2 years ago

1.1.7

2 years ago

1.1.6

2 years ago

1.1.5

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.8

2 years ago

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