Skip to main content

Select

Select components are used for collecting user provided information from a list of options.

Basic usage

import { Select } from '@streamelements/frontend-ui';

export function MySelect() {
return <Select options={[{ label: 'Option', value: 'option' }]}/>
}

Select

Select is available in browser only mode

Advanced

Select is available in browser only mode

Props

Select is based on the react-select library, So the entire props can be found Here

Name

Type

Default value

Description

options*Option[][]
type Option =
autoFocusbooleanfalse
Focus on mount
backspaceRemovesValuebooleantrue
Remove the currently focused option when the user presses backspace. Applicable when isClearable or isMulti is set to true
closeMenuOnSelectbooleantrue
Close the select menu when the user selects an option
delimiterstring
Delimiter used to join multiple values into a single HTML input value
escapeClearsValuebooleanfalse
Clear values when the menu is closed and Escape is pressed
filterOptionFunction
Custom option filtering methodSignature:
f(
option: { label: string; value: string },
value: string
): boolean
hideSelectedOptionsbooleanfalse
Hide selected option from list of options
inputValue*string""
The value of the search input
inputId*string
The id of the search input
isClearablebooleanfalse
When true, displays an X button to clear the value
isDisabledbooleanfalse
When true, prevents user interaction with the select
isLoadingbooleanfalse
When true, displays a loading indicator on the field
isMultibooleanfalse
When true, allows for multiple options to be selected
isSearchablebooleantrue
When true, allows for searching through the provided items
menuPlacementoneof "auto" | "bottom" | "top"auto
The placement of the menu in relation to the control. "auto" will flip when there isn't enough space below the control.
valueObject | Object[]
Current value
onChangeFunction
Change event handler
Signature:
See detailed types
f(
Object | Object[] | null | undefined
): void
onFocusFunction
React.FocusEventHandler<HTMLInputElement>

See the rest of the available props