Skip to main content

Select

Ant Design

The Select component is Ant Design's dropdown. Users pick one option or several from a list, such as a department or a set of tags, and can type to search when the list is long.

Properties​

Property
Description
Expected Value
LabelText shown above the field, or beside it when Layout is horizontal.Text. Default: Department
ExtraHelp text shown under the field. A validation message replaces it while the value is not valid.Text
TooltipText shown from an info icon after the label.Text
LayoutWhere the label sits: vertical puts it above the field, horizontal puts it to the left.vertical, horizontal. Default: vertical
OptionsThe choices, as plain values or as { label, value, disabled } objects, such as [{ label: 'Design', value: 'design' }].Array
ModeHow many options the user picks. Empty means one; multiple allows several; tags allows several and also lets the user type new values.Single, Multiple, Tags
ValueValue of the option picked at the start, or a list of values in multiple and tags modes. Values no option offers are dropped once the options load, except in tags mode.Text
PlaceholderHint text shown while nothing is picked.Text. Default: Select
Allow clearShows a clear icon in the field once something is picked.On or off. Default: Off
Show searchLets the user type in the field to filter the options by label.On or off. Default: Off
Not found contentText shown in the dropdown when no option matches the search.Text. Default: No options
VariantBorder style of the field. filled uses a light background, borderless has no border, and underlined shows only a bottom line.outlined, filled, borderless, underlined. Default: outlined
SizeHeight and text size of the field.small, middle, large. Default: middle

Additional Actions​

Each of these can be switched on or off, or set with a logical expression by clicking fx.

Property
Description
Expected Value
VisibilityShows or hides the component. Hidden components keep their space unless Collapse when hidden is on.On or off. Default: On
Collapse when hiddenRemoves the hidden component's space, so the components below it move up.On or off. Default: Off
Loading stateShows the component's loading look and blocks interaction, for example while a query runs.On or off. Default: Off
DisableStops the user from interacting with the component.On or off. Default: Off
Dynamic heightLets the component grow with its content in the running app instead of keeping a fixed height.On or off. Default: Off

Devices​

Property
Description
Expected Value
Show on desktopShows the component in the desktop layout.On or off. Default: On
Show on mobileShows the component in the mobile layout.On or off. Default: Off

Events​

Add a handler from the Events section of the properties panel. See Event Triggers for the steps.

Event
Description
On changeTriggers when the picked value changes, including when it's cleared.
On selectTriggers when the user picks an option from the dropdown.
On clearTriggers when the user clears the field with its clear icon.
On searchTriggers as the user types in the search box. The text is in searchValue.
On open changeTriggers when the dropdown opens or closes.

Component Specific Actions (CSA)​

Run these from an event handler with Control Component, or from a RunJS query. See Component Specific Actions.

Action
Description
How To Access
Set field valuePicks the option with the given Value, or the options in a list of values in multiple and tags modes.components.select1.setFieldValue("")
Reset fieldSets the field back to the Value property.components.select1.resetFields()
FocusMoves keyboard focus to the field.components.select1.focus()
BlurRemoves keyboard focus from the field.components.select1.blur()
Set visibilityShows the component when true, hides it when false.components.select1.setVisibility(false)
Set disableDisables the component when true, enables it when false.components.select1.setDisable(false)
Set loadingTurns the loading state on with true, off with false.components.select1.setLoading(false)

Exposed Variables​

Variable
Description
How To Access
labelText shown above the field, or beside it when Layout is horizontal.{{components.select1.label}}
extraHelp text shown under the field. A validation message replaces it while the value is not valid.{{components.select1.extra}}
tooltipText shown from an info icon after the label.{{components.select1.tooltip}}
layoutWhere the label sits: vertical puts it above the field, horizontal puts it to the left.{{components.select1.layout}}
optionsThe choices, as plain values or as { label, value, disabled } objects, such as [{ label: 'Design', value: 'design' }].{{components.select1.options}}
modeHow many options the user picks. Empty means one; multiple allows several; tags allows several and also lets the user type new values.{{components.select1.mode}}
valueValue of the option picked at the start, or a list of values in multiple and tags modes. Values no option offers are dropped once the options load, except in tags mode.{{components.select1.value}}
placeholderHint text shown while nothing is picked.{{components.select1.placeholder}}
allowClearShows a clear icon in the field once something is picked.{{components.select1.allowClear}}
showSearchLets the user type in the field to filter the options by label.{{components.select1.showSearch}}
notFoundContentText shown in the dropdown when no option matches the search.{{components.select1.notFoundContent}}
variantBorder style of the field. filled uses a light background, borderless has no border, and underlined shows only a bottom line.{{components.select1.variant}}
sizeHeight and text size of the field.{{components.select1.size}}
selectedOptionThe picked option as { label, value } in single mode, or {} when nothing is picked.{{components.select1.selectedOption}}
selectedOptionsThe picked options as { label, value } objects in multiple and tags modes.{{components.select1.selectedOptions}}
opentrue while the dropdown is open.{{components.select1.open}}
searchValueText typed in the search box. It empties when the dropdown closes.{{components.select1.searchValue}}
isVisibleWhether the component is visible.{{components.select1.isVisible}}
isLoadingWhether the component is in its loading state.{{components.select1.isLoading}}
isDisabledWhether the component is disabled.{{components.select1.isDisabled}}

Styles​

Style
Default
Primary colorTheme: Brand primary
Text colorTheme: Primary text
Container backgroundTheme: Surface 1
Border colorTheme: Default border
Border radius—
Box shadow0px 0px 0px 0px #00000040

A default that starts with Theme: follows the app's theme until the style is set to another value. See App Themes.