Select
A control-surface trigger with a popover list, matching the CRM Select.
When to use
Use Select when you need a control-surface trigger with a popover list, matching the crm select.
Import
TypeScript
import { Select } from '@gzodo/ui'Select is a button on .gz-control plus a positioned menu. Options support search, groups, colors, multiple values, and a clear row. onChange receives the next value and the option data. The menu width follows the trigger.
Examples
6Basic
Controlled
value. Choosing a row calls onChange(value, data) and closes the menu.Placeholder
An empty value shows
placeholder. isClearValue adds a “...” row that clears the selection.Search and groups
isSearch filters labels. Set group on options to draw section headers. color paints a status swatch.Multiple
isMultiple keeps an array of values. Selected rows show the leading dot.Sizes and width
Size follows the control scale. fullWidth stretches the trigger.
Disabled
Disable the trigger with the control surface disabled state.
Select
22Select
Property
Description
Type
Default
sizeFixed height of the control.
'sm' | 'md' | 'lg' | 'xl''md'variantSurface treatment. Primary is the main action.
'primary' | 'secondary' | 'outline' | 'ghost' | 'text' | 'base' | 'default'—
colorSemantic color layered on top of the variant.
'danger' | 'success' | 'warning'—
fullWidthStretch the control to the container width.
booleanfalsedisabledBlocks interaction and lowers opacity.
booleanfalseclassNameExtra classes, merged with the component classes.
string—
valueSelected value, or an array when isMultiple is true.
string | string[]—
optionsChoices. Each option has value, label, and optional group, color, data.
SelectOption[]—
onChangeCalled with the next value and the option data payload.
(value: string | string[], data: unknown) => void—
placeholderShown when nothing is selected.
string'Select...'isSearchShow a search field above the list.
booleanfalseisMultipleAllow several selected values.
booleanfalseisClearValueAdd a clear row when the search is empty.
booleanfalseisLoadingSpinner on the trigger and in the menu body.
boolean—
isPortalRender the menu in a portal.
booleanfalseisOpenControlled open state.
boolean—
onOpenChangeCalled when the menu opens or closes.
(open: boolean) => void—
customValueReplace the default value rendering.
ReactNode—
renderValueCustom selected value node.
(option) => ReactNode—
renderOptionCustom option row. Search highlighting is skipped.
(option, search) => ReactNode—
iconLeftIcon before the value.
ReactNode—
iconRightIcon after the value.
ReactNode—
SelectOption
5SelectOption
Property
Description
Type
Default
valueOption id written into value.
string—
labelVisible label.
string—
groupSection title in the menu.
string—
colorStatus swatch. Theme tones or any CSS color.
string—
dataPassed as the second onChange argument.
unknown—