Select
Click me!
Interfaces
SelectOption
Defined in: select.types.ts:9
An option for the Select component.
Type Parameters
T
T = any
Properties
key?
optionalkey:string
Defined in: select.types.ts:24
The key of the option. Must be a unique string. If none is provided, a random key will be generated. The key will be used to map the option to the select element. ⚠️ Note: If a key is generated, the original object will be mutated.
Default
crypto.randomUUID();label
label:
string
Defined in: select.types.ts:17
The label of the option.
value
value:
T
Defined in: select.types.ts:13
The value of the option.
SelectProps
Defined in: select.types.ts:31
The Select component properties.
Extends
unknown<JSX.SelectHTMLAttributes<HTMLSelectElement>>
Type Parameters
T
T = any
Properties
default?
optionaldefault:string|number|SelectOption<T>
Defined in: select.types.ts:47
The option or index that is initially selected. If none is provided, the first option will be selected.
Default
undefined;disabled?
optionaldisabled:boolean
Defined in: select.types.ts:67
Whether the select is disabled.
Default
false;icon?
optionalicon:string
Defined in: select.types.ts:52
An optional icon to render as part of the label.
Default
undefined;label
label:
string
Defined in: select.types.ts:36
The select label.
onChange()?
optionalonChange: <T>(option,event) =>void
Defined in: select.types.ts:74
Called when the selected option changes.
Type Parameters
T
T = unknown
Parameters
option
SelectOption<T>
The selected option
event
Event & object
The select event.
Returns
void
Default
undefined;options
options:
SelectOption<T>[]
Defined in: select.types.ts:41
An optional list of options for the select. Will be rendered into a
size?
optionalsize:ControlSize
Defined in: select.types.ts:57
The size of the select.
Default
undefined;variant?
optionalvariant:string
Defined in: select.types.ts:62
The select variant.
Default
'contained';Variables
Select
constSelect:Component<SelectProps>
Defined in: select.component.tsx:10
A flexible select component.
Param
Returns
The select component.