DynamicSelect
This component is used to create a select box with pagination (infinite scrolling) & search/filter options. Support keyboard interactions
Arrow Keys (up & down) - navigate through options list
Enter Key - Select current highlighted option
Escape Key - Exit select mode & discard changes
Installation
Examples
Properties
options
List of options to render. This a function that will generate the array of objects. pagination will be supported. The function expects 2 parameters - max and last and returns a promise that will resolve to the list of objects. max specifies the maximum number of items to be returned.
selected
string
selected option label
onChange
(value: any) => void
Callback that gets executed whenever a option is selected/changed
placeholder
string
placeholder text
className
string
Any extra css classes to add to the button
isValid
boolean
set to valid state if true
pageSize
number
page size for pagination
renderOption
(item: any, key: number) => JSX.Element
A function that will be responsible for rendering each individual option of the list.
labelField
string
name of the field to display
iconField
string
Name if the field to use as icon if a value is passed icon will be displayed.
timeout
number
number of milliseconds to delay send the request on change query default is 500
type
"search-box" | "select-box"
showEndOfContent
boolean
show hide end of content message
options
List of options to render. This a function that will generate the array of objects. pagination will be supported. The function expects 2 parameters - max and last and returns a promise that will resolve to the list of objects. max specifies the maximum number of items to be returned.
selected
selected option label
string
onChange
Callback that gets executed whenever a option is selected/changed
(value: any) => void
placeholder
placeholder text
string
className
Any extra css classes to add to the button
string
isValid
set to valid state if true
boolean
pageSize
page size for pagination
number
renderOption
A function that will be responsible for rendering each individual option of the list.
(item: any, key: number) => JSX.Element
labelField
name of the field to display
string
iconField
Name if the field to use as icon if a value is passed icon will be displayed.
string
timeout
number of milliseconds to delay send the request on change query default is 500
number
type
"search-box" | "select-box"
showEndOfContent
show hide end of content message
boolean
Last updated