Select
A dropdown selection interface element that allows users to choose one option from a given set.
code
Expend code
#DefaultSelected
code
Expend code
#Description
code
Expend code
#Hidden
code
Expend code
#Disabled
code
Expend code
Select
The properties of the Select component.
Prop | Type | Default | Description |
---|---|---|---|
className | string | undefined | Specifies additional CSS classes for the Select component. |
options | { label: string, value: string, description?: string, hidden?: boolean }[] | [] | The list of options to display in the dropdown. Each option can include a label, value, an optional description for additional details, and an optional hidden flag to exclude the option from the dropdown. |
onSelect | (value: string) => void | undefined | Callback function called when the selected value changes. |
defaultSelected | string | Value of the first non-hidden option | Sets the value of the option that is selected by default when the component is first rendered. |
description | string | undefined | Optional description for the option, which is displayed under the label. |
hidden | boolean | false | If true, the option will not be displayed in the dropdown. |
disabled | boolean | false | If true, the option will be displayed but cannot be selected. But you can set it as the default selected option. |