Select
A dropdown for choosing a single option from a list.
A Select lets users choose a single option from a dropdown list. Items are
passed as an array of { value, label } objects, and separators can be mixed in
to group related options.
import { Select, type SelectItem } from '@workflowbuilder/ui';import { useState } from 'react';
const ITEMS: SelectItem[] = [ { value: 'opus', label: 'Claude Opus' }, { value: 'sonnet', label: 'Claude Sonnet' }, { value: 'haiku', label: 'Claude Haiku' },];
function Example() { const [model, setModel] = useState<string | number | null>('opus'); return ( <Select items={ITEMS} value={model} placeholder="Choose a model" onChange={(_event, next) => setModel(next)} /> );}itemsrequiredList of items to display in the select dropdown
classNameCustom class name for the component.
defaultValueThe default value of the select when uncontrolled.
disabledWhether the select is disabled.
errorWhether the select has an error
helperTextMessage rendered under the control and announced with it.
idIdentifies the control; a generated id is used when omitted.
isRequiredAdds the required marker next to the label.
labelLabel rendered above the control and linked to it.
nameIdentifies the field when a form is submitted.
onChangeCallback fired when the value of the select changes.
placeholderPlaceholder text for the select input
requiredWhether the user must choose a value before submitting a form.
sizeSize of the select input
stateVisual state of the control.
valueThe controlled value of the select.
CSS variables
Section titled “CSS variables”Color
--wb-public-select-button-color--wb-public-select-button-border-color--wb-public-select-button-border-color-focus--wb-public-select-button-focus-ring-color--wb-public-select-button-color-disabled--wb-public-select-button-background-color-disabled--wb-public-select-button-background-color-error--wb-public-select-button-border-color-error--wb-public-select-button-color-errorSize
--wb-public-select-border-size