Skip to documentation

Select

Base UI-powered Select component.

import { Select } from '@lobehub/ui/base-ui';
Data Entry

Default

Loading preview

Clear Value Contract

Loading preview
Loading preview

Tags with Closed Popup

Loading preview

Atom Components

Loading preview

Custom Render

Loading preview

Selected Indicator Variant

Loading preview

Virtual List

Loading preview

APIs

Select

Select properties
allowClear
boolean
autoFocus
boolean
behaviorVariant
'default' | 'item-aligned'

Behavior variant for Base UI Select. - `default`: regular dropdown positioning (alignItemWithTrigger=false, modal=false) - `item-aligned`: aligns the selected item with trigger and uses modal=true

Defaults to "default".

className
string
classNames
SelectClassNames
defaultOpen
boolean
defaultValue
any
disabled
boolean
id
string
labelRender
(option: SelectOption<any>) => ReactNode
listHeight
number

设置弹窗滚动高度

Defaults to 512.

listItemHeight
number
loading
boolean
mode
'multiple' | 'tags'
name
string
onChange
(value: any, option?: SelectOption<any> | SelectOption<any>[] | undefined) => void
onOpenChange
(open: boolean, eventDetails?: SelectRootChangeEventDetails) => void
onSelect
(value: any, option?: SelectOption<any> | undefined) => void
open
boolean
optionRender
(option: SelectOption<any>, info: { index: number; }) => ReactNode
options
SelectOptions<any>
placeholder
null | string | number | bigint | false | true | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | Promise<AwaitedReactNode>
popupClassName
string
popupMatchSelectWidth
number | false | true
prefix
null | string | number | bigint | false | true | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | Promise<AwaitedReactNode> | LucideIcon | FC<any>
readOnly
boolean
required
boolean
selectedIndicatorVariant
'bold' | 'check'

Variant for how selected items are indicated in the popup. - `check`: Display a checkmark icon next to selected items (default) - `bold`: Display selected items with bold text, no checkmark

Defaults to "check".

shadow
boolean
showSearch
boolean
size
'large' | 'middle' | 'small'

Defaults to "middle".

style
CSSProperties
suffixIcon
null | string | number | bigint | false | true | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | Promise<AwaitedReactNode> | LucideIcon | FC<any>
suffixIconProps
Omit<IconProps, 'icon'>
tokenSeparators
string[]
value
any
variant
'borderless' | 'filled' | 'outlined'
virtual
boolean

SelectOption

PropertyDescriptionTypeDefault
classNameThe className of optionstring-
disabledWhether disabledboolean-
labelDisplay text of optionReactNode-
styleCSS style of optionCSSProperties-
titleTitle attribute for optionstring-
valueValue of optionValue-

SelectOptionGroup

PropertyDescriptionTypeDefault
disabledWhether disabledboolean-
labelDisplay text of groupReactNode-
optionsOptions in this groupSelectOption[]-

SelectClassNames

PropertyDescription
clearClear button
dropdownDropdown container (alias for popup)
emptyEmpty state
groupOption group
groupLabelGroup label
iconSuffix icon
itemOption item
itemIndicatorSelected indicator
itemTextOption text
listOptions list
optionOption item (alias for item)
popupPopup container
prefixPrefix element
rootRoot container (alias for trigger)
searchSearch input container
suffixSuffix container
triggerTrigger element
valueValue display