logoAnt Design

⌘ K
  • Design
  • Development
  • Components
  • Blog
  • Resources
YouMindTRACTIANLobeHubCodeRabbit
6.4.5
  • Components Overview
  • Changelog
    v6.4.5
  • General
    • Button
    • FloatButton
    • Icon
    • Typography
  • Layout
    • Divider
    • Flex
    • Grid
    • Layout
    • Masonry
      6.0.0
    • Space
    • Splitter
  • Navigation
    • Anchor
    • Breadcrumb
    • Dropdown
    • Menu
    • Pagination
    • Steps
    • Tabs
  • Data Entry
    • AutoComplete
    • Cascader
    • Checkbox
    • ColorPicker
    • DatePicker
    • Form
    • Input
    • InputNumber
    • Mentions
    • Radio
    • Rate
    • Select
    • Slider
    • Switch
    • TimePicker
    • Transfer
    • TreeSelect
    • Upload
  • Data Display
    • Avatar
    • Badge
    • Calendar
    • Card
    • Carousel
    • Collapse
    • Descriptions
    • Empty
    • Image
    • List
      DEPRECATED
    • Popover
    • QRCode
    • Segmented
    • Statistic
    • Table
    • Tag
    • Timeline
    • Tooltip
    • Tour
    • Tree
  • Feedback
    • Alert
    • Drawer
    • Message
    • Modal
    • Notification
    • Popconfirm
    • Progress
    • Result
    • Skeleton
    • Spin
    • Watermark
  • Other
    • Affix
    • App
    • BorderBeam
      6.4.0
    • ConfigProvider
    • Util
When To Use
Examples
Basic Usage
Select with search field
Custom Search
Multi field search
multiple selection
Sizes
Custom dropdown options
Search with sort
Tags
Option Group
coordinate
Get value of selected item
Automatic tokenization
Custom tokenization
Search and Select Users
Prefix and Suffix
Custom dropdown
Hide Already Selected
Variants
Custom Tag Render
Custom Selected Label Render
Responsive maxTagCount
Big Data
Status
Placement
Max Count
Custom semantic dom styling
API
Select props
showSearch
Select Methods
Option props
OptGroup props
Semantic DOM
Design Token
FAQ
Why sometimes search will show 2 same option when in tags mode?
When I click elements in popupRender, the select dropdown will not be closed?
I don't want dropdown close when click inside popupRender?
Why sometimes customize Option cause scroll break?
Why a11y test report missing aria- props?
Why does clicking close on a custom tagRender tag open the dropdown?

Select

A dropdown menu for displaying choices.
Importimport { Select } from 'antd';
GitHub
components/selectIssueOpen issues
Docs
Edit this pageLLMs.md
RateSlider

Resources

Ant Design X
Ant Design Charts
Ant Design Pro
Pro Components
Ant Design Mobile
Ant Design Mini
Ant Design Web3
Ant Design Landing-Landing Templates
Scaffolds-Scaffold Market
Umi-React Application Framework
dumi-Component doc generator
qiankun-Micro-Frontends Framework
Ant Motion-Motion Solution
China Mirror 🇨🇳

Community

Awesome Ant Design
Medium
X
yuque logoAnt Design in YuQue
Ant Design in Zhihu
Experience Cloud Blog
seeconf logoSEE Conf-Experience Tech Conference

Help

GitHub
Change Log
FAQ
For Agents
Bug Report
Issues
Discussions
StackOverflow
SegmentFault

Ant XTech logoMore Products

yuque logoYuQue-Document Collaboration Platform
AntV logoAntV-Data Visualization
Egg logoEgg-Enterprise Node.js Framework
Kitchen logoKitchen-Sketch Toolkit
Galacean logoGalacean-Interactive Graphics Solution
WeaveFox logoWeaveFox-AI Development with WeaveFox 🦊
xtech logoAnt Financial Experience Tech
Theme Editor
Made with ❤ by
Ant Group and Ant Design Community
loading

When To Use

  • A dropdown menu for displaying choices - an elegant alternative to the native <select> element.
  • Utilizing Radio is recommended when there are fewer total options (less than 5).
  • You probably need AutoComplete if you're looking for an input box that can be typed or selected.

Examples

API

Common props ref:Common props

Select props

PropertyDescriptionTypeDefaultVersionGlobal Config
allowClearCustomize clear iconboolean | { clearIcon?: ReactNode }false5.8.0: Support object type6.4.0
autoClearSearchValueWhether the current search will be cleared on selecting an item. Only applies when mode is set to multiple or tagsbooleantrue×
borderedWhether has border style, please use variant insteadbooleantrue-×
classNamesCustomize class for each semantic structure inside the Select component. Supports object or function.Record<SemanticDOM, string> | (info: { props })=> Record<SemanticDOM, string>-5.25.0
defaultActiveFirstOptionWhether active first option by defaultbooleantrue×
defaultOpenInitial open state of dropdownboolean-×
defaultValueInitial selected optionstring | string[] |
number | number[] |
LabeledValue | LabeledValue[]
-×
disabledWhether disabled selectbooleanfalse×
dropdownClassNameThe className of dropdown menu, please use classNames.popup.root insteadstring--×
dropdownMatchSelectWidthDetermine whether the popup menu and the select input are the same width, please use popupMatchSelectWidth insteadboolean | numbertrue-×
popupClassNameThe className of dropdown menu, use classNames.popup.root insteadstring-4.23.0×
popupMatchSelectWidthDetermine whether the popup menu and the select input are the same width. Default set min-width same as input. Will ignore when value less than select width. false will disable virtual scrollboolean | numbertrue5.5.0×
dropdownRenderCustomize dropdown content, use popupRender instead(originNode: ReactNode) => ReactNode-×
popupRenderCustomize dropdown content(originNode: ReactNode) => ReactNode-5.25.0×
dropdownStyleThe style of dropdown menu, use styles.popup.root insteadCSSProperties-×
fieldNamesCustomize node label, value, options,groupLabel field nameobject{ label: label, value: value, options: options, groupLabel: label }4.17.0 (groupLabel added in 5.6.0)×
filterOptionIf true, filter options by input, if function, filter options against it. The function will receive two arguments, inputValue and option, if the function returns true, the option will be included in the filtered set; Otherwise, it will be excludedboolean | function(inputValue, option)true×
filterSortSort function for search options sorting, see Array.sort's compareFunction(optionA: Option, optionB: Option, info: { searchValue: string }) => number-searchValue: 5.19.0×
getPopupContainerParent Node which the selector should be rendered to. Default to body. When position issues happen, try to modify it into scrollable content and position it relative. Examplefunction(triggerNode)() => document.body×
labelInValueWhether to embed label in value, turn the format of value from string to { value: string, label: ReactNode }booleanfalse×
listHeightConfig popup heightnumber256×
loadingIndicate loading statebooleanfalse×
loadingIconCustomize the loading iconReactNode<LoadingOutlined spin />6.4.06.4.0
maxCountThe max number of items can be selected, only applies when mode is multiple or tagsnumber-5.13.0×
maxTagCountMax tag count to show. responsive will cost render performancenumber | responsive-responsive: 4.10×
maxTagPlaceholderPlaceholder for not showing tagsReactNode | function(omittedValues)-×
maxTagTextLengthMax tag text length to shownumber-×
menuItemSelectedIconThe custom menuItemSelected icon with multiple optionsReactNode<CheckOutlined />6.4.0
modeSet mode of Selectmultiple | tags-×
notFoundContentSpecify content to show when no result matchesReactNodeNot Found×
openControlled open state of dropdownboolean-×
optionFilterPropDeprecated, see showSearch.optionFilterProp×
optionLabelPropWhich prop value of option will render as content of select. Examplestringchildren×
optionsSelect options. Will get better perf than jsx definition{ label, value }[]-×
optionRenderCustomize the rendering dropdown options(option: FlattenOptionData<BaseOptionType> , info: { index: number }) => React.ReactNode-5.11.0×
placeholderPlaceholder of selectReactNode-×
placementThe position where the selection box pops upbottomLeft bottomRight topLeft topRightbottomLeft×
prefixThe custom prefixReactNode-5.22.0×
removeIconThe custom remove iconReactNode<CloseOutlined />6.4.0
searchValueThe current input "search" textstring-×
showArrowWhether to show the arrow icon, please use suffixIcon={null} insteadbooleantrue-×
showSearchWhether select is searchableboolean | Objectsingle: false, multiple: trueObject: 6.0.06.4.0
sizeSize of Select inputlarge | medium | smallmedium×
statusSet validation status'error' | 'warning'-4.19.0×
stylesCustomize inline style for each semantic structure inside the Select component. Supports object or function.Record<SemanticDOM, CSSProperties> | (info: { props })=> Record<SemanticDOM, CSSProperties>-5.25.0
suffixIconThe custom suffix icon. Custom icons will not respond to clicks to open, because the replaced icon may be designed for other interactions. You can use pointer-events: none style to bypassReactNode<DownOutlined />6.4.0
tagRenderCustomize tag render, only applies when mode is set to multiple or tags(props) => ReactNode-×
labelRenderCustomize selected label render (LabelInValueType definition see LabelInValueType)(props: LabelInValueType) => ReactNode-5.15.0×
tokenSeparatorsSeparator used to tokenize, only applies when mode="tags" or mode="multiple"string[] | ((input: string) => string[])-function: 6.5.0×
valueCurrent selected option (considered as a immutable array)string | string[] |
number | number[] |
LabeledValue | LabeledValue[]
-×
variantVariants of selectoroutlined | borderless | filled | underlinedoutlined5.13.0 | underlined: 5.24.05.19.0
virtualDisable virtual scroll when set to falsebooleantrue4.1.0×
onActiveCalled when keyboard or mouse interaction occursfunction(value: string | number | LabeledValue)-×
onBlurCalled when blurfunction-×
onChangeCalled when select an option or input value changefunction(value, option:Option | Array<Option>)-×
onClearCalled when clearfunction-4.6.0×
onDeselectCalled when an option is deselected, param is the selected option's value. Only called for multiple or tags, effective in multiple or tags mode onlyfunction(value: string | number | LabeledValue)-×
onDropdownVisibleChangeCalled when dropdown open, use onOpenChange instead(open: boolean) => void-×
onOpenChangeCalled when dropdown open(open: boolean) => void-×
onFocusCalled when focus(event: FocusEvent) => void-×
onInputKeyDownCalled when key pressed(event: KeyboardEvent) => void-×
onPopupScrollCalled when dropdown scrolls(event: UIEvent) => void-×
onSearchCallback function that is fired when input changedfunction(value: string)-×
onSelectCalled when an option is selected, the params are option's value (or key) and option instancefunction(value: string | number | LabeledValue, option: Option)-×

Note, if you find that the drop-down menu scrolls with the page, or you need to trigger Select in other popup layers, please try to use getPopupContainer={triggerNode => triggerNode.parentElement} to fix the drop-down popup rendering node in the parent element of the trigger .

showSearch

PropertyDescriptionTypeDefaultVersion
autoClearSearchValueWhether the current search will be cleared on selecting an item. Only applies when mode is set to multiple or tagsbooleantrue
filterOptionIf true, filter options by input, if function, filter options against it. The function will receive two arguments, inputValue and option, if the function returns true, the option will be included in the filtered set; Otherwise, it will be excludedboolean | function(inputValue, option)true
filterSortSort function for search options sorting, see Array.sort's compareFunction(optionA: Option, optionB: Option, info: { searchValue: string }) => number-searchValue: 5.19.0
optionFilterPropWhich prop value of option will be used for filter if filterOption is true.
If options is set, it should be set to label.
When a string[] is provided, multiple fields are searched using OR matching.
string | string[]valuestring[]: 6.1.0
searchValueThe current input "search" textstring-
onSearchCallback function that is fired when input changedfunction(value: string)-
searchIconCustomize the search iconReactNode<SearchOutlined />6.4.0

Select Methods

NameDescriptionVersion
blur()Remove focus
focus()Get focus

Option props

PropertyDescriptionTypeDefaultVersion
classNameThe additional class to optionstring-
disabledDisable this optionbooleanfalse
titletitle attribute of Select Optionstring-
valueDefault to filter with this propertystring | number-

OptGroup props

PropertyDescriptionTypeDefaultVersion
keyGroup keystring-
labelGroup labelReact.ReactNode-
classNameThe additional class to optionstring-
titletitle attribute of Select Optionstring-

Semantic DOM

Design Token

Component TokenHow to use?
Token NameDescriptionTypeDefault Value
activeBorderColorActive border colorstring#1677ff
activeOutlineColorActive outline colorstringrgba(5,145,255,0.1)
clearBgBackground color of clear buttonstring#ffffff
hoverBorderColorHover border colorstring#4096ff
multipleItemBgBackground color of multiple tagstringrgba(0,0,0,0.06)
multipleItemBorderColorBorder color of multiple tagstringtransparent
multipleItemBorderColorDisabledBorder color of multiple tag when disabledstringtransparent
multipleItemColorDisabledText color of multiple tag when disabledstringrgba(0,0,0,0.25)
multipleItemHeightHeight of multiple tagnumber24
multipleItemHeightLGHeight of multiple tag with large sizenumber32
multipleItemHeightSMHeight of multiple tag with small sizenumber16
multipleSelectorBgDisabledBackground color of multiple selector when disabledstringrgba(0,0,0,0.04)
optionActiveBgBackground color when option is activestringrgba(0,0,0,0.04)
optionFontSizeFont size of optionnumber14
optionHeightHeight of optionnumber32
optionLineHeightLine height of optionLineHeight<string | number> | undefined1.5714285714285714
optionPaddingPadding of optionPadding<string | number> | undefined5px 12px
optionSelectedBgBackground color when option is selectedstring#e6f4ff
optionSelectedColorText color when option is selectedstringrgba(0,0,0,0.88)
optionSelectedFontWeightFont weight when option is selectedFontWeight | undefined600
selectorBgBackground color of selectorstring#ffffff
showArrowPaddingInlineEndInline end padding of arrownumber18
singleItemHeightLGHeight of single selected item with large sizenumber40
zIndexPopupz-index of dropdownnumber1050
Global TokenHow to use?
Token NameDescriptionTypeDefault Value
colorBgBaseUsed to derive the base variable of the background color gradient. In v5, we added a layer of background color derivation algorithm to produce map token of background color. But PLEASE DO NOT USE this Seed Token directly in the code!string#fff
colorBgContainerContainer background color, e.g: default button, input box, etc. Be sure not to confuse this with `colorBgElevated`.string#ffffff
colorBgContainerDisabledControl the background color of container in disabled state.stringrgba(0,0,0,0.04)
colorBgElevatedContainer background color of the popup layer, in dark mode the color value of this token will be a little brighter than `colorBgContainer`. E.g: modal, pop-up, menu, etc.string#ffffff
colorBorderDefault border color, used to separate different elements, such as: form separator, card separator, etc.string#d9d9d9
colorBorderDisabledControl the border color of the element in the disabled state.string#d9d9d9
colorErrorUsed to represent the visual elements of the operation failure, such as the error Button, error Result component, etc.string#ff4d4f
colorErrorAffixControl the color of form control prefix/suffix in error state.string#ff4d4f
colorErrorBgThe background color of the error state.string#fff2f0
colorErrorBgHoverThe hover state background color of the error state.string#fff1f0
colorErrorBorderHoverThe hover state border color of the error state.string#ffa39e
colorErrorOutlineControl the outline color of input component in error state.stringrgba(255,38,5,0.06)
colorErrorTextThe default state of the text in the error color.string#ff4d4f
colorFillSecondaryThe second level of fill color can outline the shape of the element more clearly, such as Rate, Skeleton, etc. It can also be used as the Hover state of the third level of fill color, such as Table, etc.stringrgba(0,0,0,0.06)
colorFillTertiaryThe third level of fill color is used to outline the shape of the element, such as Slider, Segmented, etc. If there is no emphasis requirement, it is recommended to use the third level of fill color as the default fill color.stringrgba(0,0,0,0.04)
colorIconWeak action. Such as `allowClear` or Alert close buttonstringrgba(0,0,0,0.45)
colorIconHoverWeak action hover color. Such as `allowClear` or Alert close buttonstringrgba(0,0,0,0.88)
colorPrimaryBrand color is one of the most direct visual elements to reflect the characteristics and communication of the product. After you have selected the brand color, we will automatically generate a complete color palette and assign it effective design semantics.string#1677ff
colorSplitUsed as the color of separator, this color is the same as colorBorderSecondary but with transparency.stringrgba(5,5,5,0.06)
colorTextDefault text color which comply with W3C standards, and this color is also the darkest neutral color.stringrgba(0,0,0,0.88)
colorTextDescriptionControl the font color of text description.stringrgba(0,0,0,0.45)
colorTextDisabledControl the color of text in disabled state.stringrgba(0,0,0,0.25)
colorTextPlaceholderControl the color of placeholder text.stringrgba(0,0,0,0.25)
colorTextQuaternaryThe fourth level of text color is the lightest text color, such as form input prompt text, disabled color text, etc.stringrgba(0,0,0,0.25)
colorWarningUsed to represent the warning map token, such as Notification, Alert, etc. Alert or Control component(like Input) will use these map tokens.string#faad14
colorWarningAffixControl the color of form control prefix/suffix in warning state.string#faad14
colorWarningBgThe background color of the warning state.string#fffbe6
colorWarningBgHoverThe hover state background color of the warning state.string#fff1b8
colorWarningHoverThe hover state of the warning color.string#ffd666
colorWarningOutlineControl the outline color of input component in warning state.stringrgba(255,215,5,0.1)
borderRadiusBorder radius of base componentsnumber6
borderRadiusLGLG size border radius, used in some large border radius components, such as Card, Modal and other components.number8
borderRadiusSMSM size border radius, used in small size components, such as Button, Input, Select and other input components in small sizenumber4
borderRadiusXSXS size border radius, used in some small border radius components, such as Segmented, Arrow and other components with small border radius.number2
boxShadowSecondaryControl the secondary box shadow style of an element.string 0 6px 16px 0 rgba(0,0,0,0.08), 0 3px 6px -4px rgba(0,0,0,0.12), 0 9px 28px 8px rgba(0,0,0,0.05)
controlHeightThe height of the basic controls such as buttons and input boxes in Ant Designnumber32
controlHeightLGLG component heightnumber40
controlHeightSMSM component heightnumber24
controlItemBgActiveHoverControl the background color of control component item when hovering and active.string#bae0ff
controlOutlineWidthControl the outline width of input component.number2
controlPaddingHorizontalControl the horizontal padding of an element.number12
fontFamilyThe font family of Ant Design prioritizes the default interface font of the system, and provides a set of alternative font libraries that are suitable for screen display to maintain the readability and readability of the font under different platforms and browsers, reflecting the friendly, stable and professional characteristics.string-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'
fontSizeThe most widely used font size in the design system, from which the text gradient will be derived.number14
fontSizeIconControl the font size of operation icon in Select, Cascader, etc. Normally same as fontSizeSM.number12
fontSizeLGLarge font sizenumber16
fontSizeSMSmall font sizenumber12
lineHeightLine height of text.number1.5714285714285714
lineHeightLGLine height of large text.number1.5
lineTypeBorder style of base componentsstringsolid
lineWidthBorder width of base componentsnumber1
marginXSControl the margin of an element, with a small size.number8
motionDurationMidMotion speed, medium speed. Used for medium element animation interaction.string0.2s
motionDurationSlowMotion speed, slow speed. Used for large element animation interaction.string0.3s
motionEaseInOutPreset motion curve.string
Cubic Bezier Visualizer
cubic-bezier(0.645, 0.045, 0.355, 1)External Link Icon
motionEaseInOutCircPreset motion curve.string
Cubic Bezier Visualizer
cubic-bezier(0.78, 0.14, 0.15, 0.86)External Link Icon
motionEaseInQuintPreset motion curve.string
Cubic Bezier Visualizer
cubic-bezier(0.755, 0.05, 0.855, 0.06)External Link Icon
motionEaseOutCircPreset motion curve.string
Cubic Bezier Visualizer
cubic-bezier(0.08, 0.82, 0.17, 1)External Link Icon
motionEaseOutQuintPreset motion curve.string
Cubic Bezier Visualizer
cubic-bezier(0.23, 1, 0.32, 1)External Link Icon
paddingSMControl the small padding of the element.number12
paddingXSControl the extra small padding of the element.number8
paddingXXSControl the extra extra small padding of the element.number4

FAQ

Why sometimes search will show 2 same option when in tags mode?

It's caused by option with different label and value. You can use optionFilterProp="label" to change filter logic instead.

When I click elements in popupRender, the select dropdown will not be closed?

You can control it by open prop: codesandbox.

I don't want dropdown close when click inside popupRender?

Select will close when it lose focus. You can prevent event to handle this:

tsx
<Select
popupRender={() => (
<div
onMouseDown={(e) => {
e.preventDefault();
e.stopPropagation();
}}
>
Some Content
</div>
)}
/>

Why sometimes customize Option cause scroll break?

Virtual scroll internal set item height as 24px. You need to adjust listItemHeight when your option height is less and listHeight config list container height:

tsx
<Select listItemHeight={10} listHeight={250} />

Note: listItemHeight and listHeight are internal props. Please only modify when necessary.

Why a11y test report missing aria- props?

Select only create a11y auxiliary node when operating on. Please open Select and retry. For aria-label & aria-labelledby miss warning, please add related prop to Select with your own requirement.

Default virtual scrolling will create a mock element to simulate an accessible binding. If a screen reader needs to fully access the entire list, you can set virtual={false} to disable virtual scrolling and the accessibility option will be bound to the actual element.

Why does clicking close on a custom tagRender tag open the dropdown?

If you don't want a drop-down menu to appear automatically after clicking on an element (such as a close icon), you can prevent the MouseDown event from propagating on it.

tsx
<Select
tagRender={(props) => {
const { closable, label, onClose } = props;
return (
<span className="border">
{label}
{closable ? (
<span
onMouseDown={(e) => e.stopPropagation()}
onClick={onClose}
className="cursor-pointer"
>
❎
</span>
) : null}
</span>
);
}}
/>
Basic Usage

Basic Usage.

CodeSandbox Icon
Hitu Icon
codepen icon
External Link Icon
Expand Icon
Custom Search

Customize search using filterOption.

CodeSandbox Icon
Hitu Icon
codepen icon
External Link Icon
Expand Icon
multiple selection

Multiple selection, selecting from existing items.

CodeSandbox Icon
Hitu Icon
codepen icon
External Link Icon
Expand Icon
Custom dropdown options

Use optionRender to customize the rendering dropdown options

CodeSandbox Icon
Hitu Icon
codepen icon
External Link Icon
Expand Icon
Tags

Allow user to select tags from list or input custom tag.

CodeSandbox Icon
Hitu Icon
codepen icon
External Link Icon
Expand Icon
coordinate

Coordinating the selection of provinces and cities is a common use case and demonstrates how selection can be coordinated. Cascader component is strongly recommended in this case.

CodeSandbox Icon
Hitu Icon
codepen icon
External Link Icon
Expand Icon
Automatic tokenization

Try to copy Lucy,Jack and paste to the input. Only available in tags and multiple mode.

CodeSandbox Icon
Hitu Icon
codepen icon
External Link Icon
Expand Icon
Search and Select Users

A complete multiple select sample with remote search, debounce fetch, ajax callback order flow, and loading state.

CodeSandbox Icon
Hitu Icon
codepen icon
External Link Icon
Expand Icon
Custom dropdown

Customize the dropdown menu via popupRender. If you want to close the dropdown after clicking the custom content, you need to control open prop, here is an codesandbox.

CodeSandbox Icon
Hitu Icon
codepen icon
External Link Icon
Expand Icon
Variants

Variants of Select, there are four variants: outlined filled borderless and underlined.

CodeSandbox Icon
Hitu Icon
codepen icon
External Link Icon
Expand Icon
5.13.0
Custom Selected Label Render

Allows custom rendering of the currently selected label, which can be used for value backfill but the corresponding option is missing and does not want to directly render the value.

CodeSandbox Icon
Hitu Icon
codepen icon
External Link Icon
Expand Icon
Big Data

Select use virtual scroll which get better performance, turn off it by setting virtual={false}.

CodeSandbox Icon
Hitu Icon
codepen icon
External Link Icon
Expand Icon
Placement

You can manually specify the position of the popup via placement.

CodeSandbox Icon
Hitu Icon
codepen icon
External Link Icon
Expand Icon
Custom semantic dom styling

You can customize the semantic dom style of Select by passing objects/functions through classNames and styles.

CodeSandbox Icon
Hitu Icon
codepen icon
External Link Icon
Expand Icon
6.0.0
Select with search field

Search the options while expanded.

CodeSandbox Icon
Hitu Icon
codepen icon
External Link Icon
Expand Icon
Multi field search

Use optionFilterProp for multi-field search.

CodeSandbox Icon
Hitu Icon
codepen icon
External Link Icon
Expand Icon
Sizes

The height of the input field for the select defaults to 32px. If size is set to large, the height will be 40px, and if set to small, 24px.

CodeSandbox Icon
Hitu Icon
codepen icon
External Link Icon
Expand Icon
Search with sort

Search the options with sorting.

CodeSandbox Icon
Hitu Icon
codepen icon
External Link Icon
Expand Icon
Option Group

Using OptGroup to group the options.

CodeSandbox Icon
Hitu Icon
codepen icon
External Link Icon
Expand Icon
Get value of selected item

As a default behavior, the onChange callback can only get the value of the selected item. The labelInValue prop can be used to get the label property of the selected item.

The label of the selected item will be packed as an object for passing to the onChange callback.

CodeSandbox Icon
Hitu Icon
codepen icon
External Link Icon
Expand Icon
Custom tokenization

Customize tokenization logic to split input with your own rules.

CodeSandbox Icon
Hitu Icon
codepen icon
External Link Icon
Expand Icon
6.5.0
Prefix and Suffix

Custom prefix and suffixIcon.

CodeSandbox Icon
Hitu Icon
codepen icon
External Link Icon
Expand Icon
5.22.0
Hide Already Selected

Hide already selected options in the dropdown.

CodeSandbox Icon
Hitu Icon
codepen icon
External Link Icon
Expand Icon
Custom Tag Render

Allows for custom rendering of tags.

CodeSandbox Icon
Hitu Icon
codepen icon
External Link Icon
Expand Icon
Responsive maxTagCount

Auto collapse to tag with responsive case. Not recommend use in large form case since responsive calculation has a perf cost.

CodeSandbox Icon
Hitu Icon
codepen icon
External Link Icon
Expand Icon
Status

Add status to Select with status, which could be error or warning.

CodeSandbox Icon
Hitu Icon
codepen icon
External Link Icon
Expand Icon
Max Count

You can set the maxCount prop to control the max number of items can be selected. When the limit is exceeded, the options will become disabled.

CodeSandbox Icon
Hitu Icon
codepen icon
External Link Icon
Expand Icon
5.13.0
Lucy
Lucy
Lucy
Lucy
Select a person
a10
c12
a10
c12
Happy
Tags Mode
Zhejiang
Hangzhou
Select users
custom dropdown render
Outlined
Lucy
Filled
Lucy
Borderless
Lucy
Underlined
Lucy
No option match

100000 Items

a10
c12


HangZhou #310000
Object
Function
Select a person
Select an option


a1
a10
c12
a10
c12
Search to Select
lucy
Lucy (101)
Try paste: "San Francisco, CA", New York
User
Lucy
Lucy
Lucy

User
Lucy
Lucy
Lucy
Inserted are removed
gold
cyan
+ 4 ...
Select Item...
Hover Me
Ava Swift
1 / 3
prefix
Please select
  • root
    Root element with relative positioning, inline-flex layout, cursor styles, transitions, border and other basic selector container styles
  • prefix
    Prefix element with layout and styling for prefix content
  • content
    Multiple selection container with layout, spacing, and wrapping styles for selected items
  • placeholder
    Placeholder element with font styles and colors for placeholder text
  • clear
    Clear button element with layout, styling and interactive effects for clear button
  • input
    Input element with search input styling, cursor control, font inheritance and other search-related styles. Remove border styles
  • suffix
    Suffix element with layout and styling for suffix content like clear button, arrow icon, etc.
  • popup.root
    Popup element with popup layer positioning, z-index, background, border, box-shadow and other popup container styles
  • popup.list
    Popup list element with option list layout, scrolling, max-height and other list container styles
  • popup.listItem
    Popup item element with option item padding, hover effects, selected states, disabled states and other option interactive styles