Usage

Props

NameTypeRequiredDefaultDescription
afterHide
((e?: Event) => void)
false
afterShow
(() => void)
false
aria-labelledby
string
false
since

11.4.0

beforeHide
BeforeCallback
false
since

10.19.0

beforeShow
BeforeCallback
false
since

10.19.0

block
boolean
false
since

10.19.0

className
string
false
since

10.19.0

disabled
boolean
false
since

10.19.0

emptyMessage
string
false
since

10.19.0

error
boolean
false
since

10.19.0

footer
ReactNode
false
since

10.29.0

getGroup
((option: any) => string | number)
false
getId
((option: any) => string | number)
false
getLabel
((option: any) => string)
false
loading
boolean
false
since

10.19.0

onBlur
FocusEventHandler<HTMLDivElement>
false
since

10.19.0

onFocus
FocusEventHandler<HTMLDivElement>
false
since

10.19.0

onScrollBottom
((e: UIEvent<HTMLDivElement, UIEvent>) => void)
false
onSearch
((e: ChangeEvent) => void)
false
optgroups
GroupItem[]
false

Array of available option groups

options
any[]
false

Array of available options

since

10.19.0

placeholder
string
false
since

10.19.0

placementfalse
since

10.19.0

qa
QaTags
false
since

10.19.0

tabIndex
number
false
since

10.19.0

value
any[]
false

Array of the currently selected values

since

10.19.0

groupHeaderRenderer
Function
false

Callback for rendering header for each entry in groups {'(group: GroupItem) => React.ReactNode'}

since

10.19.0

isOptionDisabled
Function
false
since

10.19.0

onChange
Function
false
since

10.19.0

optionRenderer
Function
false
since

10.19.0

tokenRenderer
Function
false

Callback for rendering each selected value {'(props: TokenRendererProps) => React.ReactNode'}

since

10.19.0

For a simple MultiSelect, the default expected shape of each option is

block

You can create a full width MultiSelect by using the block attribute.

options

If you have an array of custom object shapes, you can use getId and getLabel to configure which fields each option is rendered with.

optgroups

Pass optgroups of format { id: string, label: string } and give each option a respective groupId field.

Custom onSearch

Providing your own onSearch will override the default search behavior. You can use this to fetch data, manage the loading state, or do custom filtering.

Custom Groups

Override group header view with groupHeaderRenderer, use getGroup to use a custom group field.

tokenRenderer

Use tokenRenderer to customize value tokens.

Advanced

  • Custom data structure
  • Custom optionRenderer
  • Custom tokenRenderer
  • Async loading state