MultiSelect

Designer doc
In contrast to React Select and Ant Design APIs, Coral layers the abstractions from the lowest level possible up to higher ones. So, if your use cases does not fit with some components, you can always use lower one instead.
Otherwise, it could end up with hundreds of props like in React Select, which probably very hard to maintain and fulfill developer’s vast requirements.
In your app, if some structures in MultiSelect become repetitive, you can always make your own reusable component with a higher abstraction.

Example

Basic usage
By default, Coral’s MultiSelect adds search input and you may need to handle the filter manually.
In many other cases, you may want to just have a simple multi select, you can pass null to searchElement prop like example below.
View code
An icon button can be used to trigger dropdown selection too.
View code
Customizing what to render
When you’re using search input (it’s added by default), note that the filtered options are not handled by Coral. This in most cases easier for async search, so that it avoids any confusing result callback.
Even so, component MultiSelectHighlighter is provided, which is basically a simple wrapper of react-highlight-words library with current search query.
View code
In this following example, it excludes the selected from the list, which is like in React Select. Generally, the experience is more seamless for keyboard users because they can repeteadly press Enter on the highlighted option.
View code
Custom Selected Items
By default, Coral’s MultiSelect renders selected items as MultiSelectChips, accepting value prop. You can replace this with your custom content or a simple string like example below.
Note that MultiSelectChip is an InputChip enhanced with multi-select specific handlers.
View code
When working with MultiSelectInputText, there are two states where the selected items will be rendered and customized. Customizing the selected items when MultiSelect is closed can be done through renderText prop, and when MultiSelect is opened, the customization can be done directly through the renderChip prop.
View code
Input Text and Max Tag
Though it should be simple enough to implement, Coral provides the two common input components: MultiSelectInputText and MultiSelectInputTag, which basically wraps MultiSelectInput with a higher level abstractions.
However, if you find your use cases do not fit with these components, you should fallback to MultiSelectInput component which has more powerful customization features.
View code
Disabled
View code
Invalid
View code
Virtualized
Small wrapper of SelectVirtualizedList By default, item height is 40, can manually change it by set itemSize props
View code
Customizing Popper Reference
By default, MultiSelectList popup is placed on the bottom of MultiSelectInput. To customize this, you can set the reference to the search element or any other element by specifying popperReference prop on MultiSelectList component.
Below is an example of setting MultiSelectSearch as the popup reference:
View code

Accessibility

Comparing to other related libraries, Coral is fairly superior than Ant Design (can’t navigate through selected items) and slightly better than React Select (does not always reset to first item on select).
Try navigating through selected chips using Arrow Left, Arrow Right, and Backspace to unselect.

Relevant components

References

API

MultiSelect
Prop nameTypeDefaultDescription
idstring
initialIsOpenboolean
initialKeyboardHighlightedIndexnumber
initialMouseHighlightedIndexnumber
initialSearchValuestring
initialSelectedIndexnumber
initialValueMultiSelectValue[]
isOpenboolean
keyboardHighlightedIndexnumber
mouseHighlightedIndexnumber
onChangeChangeCallback
onIsOpenChange(isOpen: boolean) => void
onKeyboardHighlightedIndexChange(index: number) => void
onMouseHighlightedIndexChange(index: number) => void
onSearchSearchCallback
onSelectChangeCallback
Different from onChange: onSelect is triggered even if the option's value is the selected one.
onSelectedIndexChange(index: number) => void
searchValuestring
This is not the selected value. Rather, it's a search value on input if you use SelectSearch.
selectedIndexnumber
stateReducerAcdcStateReducer(state, { nextState }) => nextState
valueMultiSelectValue
MultiSelectChip
Prop nameTypeDefaultDescription
asany
Tag or component, but a simple tag (i.e. built-in components, e.g. div, span) is recommended.
clickableboolean
descriptionReactNode
Description to show for capsule-large choice and filter chips.
disableNavigationboolean
disabledboolean
Equivalent to button's disabled property.
ellipsisTooltipPropsOmit<EllipsisTooltipProps, "children">
indexnumber
Order index for keyboard navigation using arrow keys. By default, this prop is automatically added by the parent.
invalidboolean
keyboardClickKeysstring[]
leftElementReactNode
Element to be added on the left side of the label. Equivalent to adding the element manually on the label with a certain margin.
onBlurFocusEventHandler<HTMLDivElement>
onClickMouseEventHandler<HTMLDivElement>
onDelete(e: SyntheticEvent<HTMLDivElement, Event>) => void
Callback on Backspace key or delete icon is clicked. If this callback is not provided, icon is not rendered - meaning it's not deletable.
onKeyDownKeyboardEventHandler<HTMLDivElement>
onKeyUpKeyboardEventHandler<HTMLDivElement>
onMouseDownMouseEventHandler<HTMLDivElement>
onMouseLeaveMouseEventHandler<HTMLDivElement>
onMouseUpMouseEventHandler<HTMLDivElement>
onReleaseEventHandler<SyntheticEvent<HTMLDivElement, Event>>
Callback that's triggered after click i.e. mouseup and keyup of enter or space.
onTouchEndTouchEventHandler<HTMLDivElement>
onTouchStartTouchEventHandler<HTMLDivElement>
rightElementReactNode
Element to be added on the right side of the label. Equivalent to adding the element manually on the label with a certain margin.
valueSelectValue
variantChipVariants
MultiSelectEllipsisTooltip
Prop nameTypeDefaultDescription
activeboolean
arrowArrowProps
asany
Tag or component, but a simple tag (i.e. built-in components, e.g. div, span) is recommended.
closeDelaynumber
containerHTMLElement
containerPropsInnerProps
contentPropsInnerProps
immediateboolean
initialActiveboolean
initialImmediateboolean
maxRowsnumber
offset[number, number]
onActiveChange(active: boolean) => void
onImmediateChange(immediate: boolean) => void
onOverflowChange(overflow: boolean) => void
openDelaynumber
overflowboolean
placement"left" | "right" | "bottom" | "top" | "top-start" | "top-end" | "left-start" | "left-end" | "right-start" | "right-end" | "bottom-start" | "bottom-end"
popperOptionsPopperPopperOptions
Options for Popper.js instance
popperUpdateKeystring
renderChild(child: any, handlers: any, ariaAttrs: any) => ReactNode
springConfigPartial<AnimationConfig>
titleReactNode
titleContainerPropsHTMLAttributes<HTMLDivElement>
variantTooltipVariants
MultiSelectHighlighter
Prop nameTypeDefaultDescription
textstring
MultiSelectIconButton
Prop nameTypeDefaultDescription
asany
Tag or component, but a simple tag (i.e. built-in components, e.g. div, span) is recommended.
badgeCountnumber
badgePropsOmit<BadgeProps, "children">
colorTypeColorTypes
Set color based on theme. If color is specified, that prop is used instead of this.
disabledboolean
Equivalent to button's disabled property.
keyboardClickKeysstring[][]
loadingboolean
onBlurFocusEventHandler<HTMLDivElement>
onClickMouseEventHandler<HTMLDivElement>
onKeyDownKeyboardEventHandler<HTMLDivElement>
onKeyUpKeyboardEventHandler<HTMLDivElement>
onMouseDownMouseEventHandler<HTMLDivElement>
onMouseLeaveMouseEventHandler<HTMLDivElement>
onMouseUpMouseEventHandler<HTMLDivElement>
onReleaseEventHandler<SyntheticEvent<HTMLDivElement, Event>>
Callback that's triggered after click i.e. mouseup and keyup of enter or space.
onTouchEndTouchEventHandler<HTMLDivElement>
onTouchStartTouchEventHandler<HTMLDivElement>
radiusstring
sizeIconButtonSizes
tooltipReactNode
tooltipPropsOmit<TooltipProps, "title" | "children">
variantIconButtonVariants
MultiSelectInput
Prop nameTypeDefaultDescription
asany
Tag or component, but a simple tag (i.e. built-in components, e.g. div, span) is recommended.
disableChipNavigationboolean
disabledboolean
Equivalent to button's disabled property.
inputChipListPropsInputChipListProps & { ref?: Ref<HTMLDivElement>; }
keyboardClickKeysstring[][]
onBlurFocusEventHandler<HTMLDivElement>
onClickMouseEventHandler<HTMLDivElement>
onKeyDownKeyboardEventHandler<HTMLDivElement>
onKeyUpKeyboardEventHandler<HTMLDivElement>
onMouseDownMouseEventHandler<HTMLDivElement>
onMouseLeaveMouseEventHandler<HTMLDivElement>
onMouseUpMouseEventHandler<HTMLDivElement>
onReleaseEventHandler<SyntheticEvent<HTMLDivElement, Event>>
Callback that's triggered after click i.e. mouseup and keyup of enter or space.
onTouchEndTouchEventHandler<HTMLDivElement>
onTouchStartTouchEventHandler<HTMLDivElement>
placeholderReactNode
renderChip(val: SelectValue, i: number) => ReactNode(val) => <MultiSelectChip key={val} value={val} />
Renders chips per value when MultiSelect is open
searchElementReactNode<MultiSelectSearch />
MultiSelectInputMaxTag
Prop nameTypeDefaultDescription
asany
Tag or component, but a simple tag (i.e. built-in components, e.g. div, span) is recommended.
disableChipNavigationboolean
disabledboolean
Equivalent to button's disabled property.
inputChipListPropsInputChipListProps & { ref?: Ref<HTMLDivElement>; }
keyboardClickKeysstring[]
labelReactNode
limitnumber2
onBlurFocusEventHandler<HTMLDivElement>
onClickMouseEventHandler<HTMLDivElement>
onKeyDownKeyboardEventHandler<HTMLDivElement>
onKeyUpKeyboardEventHandler<HTMLDivElement>
onMouseDownMouseEventHandler<HTMLDivElement>
onMouseLeaveMouseEventHandler<HTMLDivElement>
onMouseUpMouseEventHandler<HTMLDivElement>
onReleaseEventHandler<SyntheticEvent<HTMLDivElement, Event>>
Callback that's triggered after click i.e. mouseup and keyup of enter or space.
onTouchEndTouchEventHandler<HTMLDivElement>
onTouchStartTouchEventHandler<HTMLDivElement>
placeholderReactNode
renderChip(val: SelectValue, i: number) => ReactNode
Renders chips per value when MultiSelect is open
searchElementReactNode
tooltipPropsOmit<TooltipProps, "title" | "children"> & { children?: ReactNode; title?: ReactNode; }
MultiSelectInputText
Prop nameTypeDefaultDescription
asany
Tag or component, but a simple tag (i.e. built-in components, e.g. div, span) is recommended.
contentPropsContentProps{}
disableChipNavigationboolean
disabledboolean
Equivalent to button's disabled property.
inputChipListPropsInputChipListProps & { ref?: Ref<HTMLDivElement>; }
keyboardClickKeysstring[]
onBlurFocusEventHandler<HTMLDivElement>
onClickMouseEventHandler<HTMLDivElement>
onKeyDownKeyboardEventHandler<HTMLDivElement>
onKeyUpKeyboardEventHandler<HTMLDivElement>
onMouseDownMouseEventHandler<HTMLDivElement>
onMouseLeaveMouseEventHandler<HTMLDivElement>
onMouseUpMouseEventHandler<HTMLDivElement>
onReleaseEventHandler<SyntheticEvent<HTMLDivElement, Event>>
Callback that's triggered after click i.e. mouseup and keyup of enter or space.
onTouchEndTouchEventHandler<HTMLDivElement>
onTouchStartTouchEventHandler<HTMLDivElement>
placeholderReactNode
renderChip(val: SelectValue, i: number) => ReactNode
Renders chips per value when MultiSelect is open
renderText(val: MultiSelectValue) => ReactNode
Renders displayed text when MultiSelect is closed
searchElementReactNode
tooltipPropsOmit<EllipsisTooltipProps, "children"> & { children?: ReactNode; }
MultiSelectList
Prop nameTypeDefaultDescription
acdcScrollerPropsOptionsUseAcdcScrollerPropsOptions
Options for the useAcdcScrollerProps hook
asany
Tag or component, but a simple tag (i.e. built-in components, e.g. div, span) is recommended.
containerHTMLElement
containerPropsDivProps
elevationLevelnumber
emptyPlaceholderReactNode
footerReactNode
headerReactElement<any, any>
immediateboolean
placement"left" | "right" | "bottom" | "top" | "top-start" | "top-end" | "left-start" | "left-end" | "right-start" | "right-end" | "bottom-start" | "bottom-end"
popperReferenceHTMLElement
popperUpdateKeystring
widthSelectListWidth
MultiSelectListFooter
Prop nameTypeDefaultDescription
asany
Tag or component, but a simple tag (i.e. built-in components, e.g. div, span) is recommended.
MultiSelectListSearch
Prop nameTypeDefaultDescription
asany
Tag or component, but a simple tag (i.e. built-in components, e.g. div, span) is recommended.
autoComplete"on" | "off" | "nope"
disabledboolean
fullWidthboolean
width: 100% is too troublesome to handle with custom css because of the nesting
invalidboolean
leftElementReactNode
leftElementContainerPropsHTMLAttributes<HTMLDivElement> & { ref?: MutableRefObject<HTMLDivElement>; }
onChange(e: ChangeEvent<HTMLInputElement>) => void
onTextChange(val: string) => void
placeholderReactNode
readOnlyboolean
rightElementReactNode
rightElementContainerPropsHTMLAttributes<HTMLDivElement> & { ref?: MutableRefObject<HTMLDivElement>; }
type"number" | "text" | "password"
wrapperPropsWrapperProps
MultiSelectOption
Prop nameTypeDefaultDescription
asany
Tag or component, but a simple tag (i.e. built-in components, e.g. div, span) is recommended.
checkboxIconPropCheckboxIconProps
disabledboolean
indexnumber
valueSelectValue
MultiSelectSearch
Prop nameTypeDefaultDescription
asany
Tag or component, but a simple tag (i.e. built-in components, e.g. div, span) is recommended.
MultiSelectVirtualizedList
Prop nameTypeDefaultDescription
acdcScrollerPropsOptionsUseAcdcScrollerPropsOptions
Options for the useAcdcScrollerProps hook
asany
Tag or component, but a simple tag (i.e. built-in components, e.g. div, span) is recommended.
containerHTMLElement
containerPropsDivProps
elevationLevelnumber
emptyPlaceholderReactNode
estimatedItemSizenumber
footerReactNode
headerReactElement<any, any>
immediateboolean
innerPropsHTMLAttributes<HTMLUListElement> & { as?: any; ref?: Ref<HTMLUListElement>; }
itemSize(index: number) => number
overscanCountnumber
placement"left" | "right" | "bottom" | "top" | "top-start" | "top-end" | "left-start" | "left-end" | "right-start" | "right-end" | "bottom-start" | "bottom-end"
popperReferenceHTMLElement
popperUpdateKeystring
widthSelectListWidth
    Example
    Example
    Basic usage
    Basic usage
    Customizing what to render
    Customizing what to render
    Custom Selected Items
    Custom Selected Items
    Input Text and Max Tag
    Input Text and Max Tag
    Disabled
    Disabled
    Invalid
    Invalid
    Virtualized
    Virtualized
    Customizing Popper Reference
    Customizing Popper Reference
    Accessibility
    Accessibility
    Relevant components
    Relevant components
    References
    References
    API
    API
    MultiSelect
    MultiSelect
    MultiSelectChip
    MultiSelectChip
    MultiSelectEllipsisTooltip
    MultiSelectEllipsisTooltip
    MultiSelectHighlighter
    MultiSelectHighlighter
    MultiSelectIconButton
    MultiSelectIconButton
    MultiSelectInput
    MultiSelectInput
    MultiSelectInputMaxTag
    MultiSelectInputMaxTag
    MultiSelectInputText
    MultiSelectInputText
    MultiSelectList
    MultiSelectList
    MultiSelectListFooter
    MultiSelectListFooter
    MultiSelectListSearch
    MultiSelectListSearch
    MultiSelectOption
    MultiSelectOption
    MultiSelectSearch
    MultiSelectSearch
    MultiSelectVirtualizedList
    MultiSelectVirtualizedList
Coral is a thoroughly developed design system widely adopted by developers and designers for creating beautiful and user-friendly Sea internal products.

Copyright © 2018-2025 Sea Labs