Select
A customizable dropdown select component.
Component Preview
Props
| Prop | Type | Description |
|---|---|---|
options | SelectOption[] | Array of options to display. |
defaultValue | string | The initial value of the select. |
value | string | Controlled value of the select. |
onChange | (value: string) => void | Callback function when value changes. |
icon | string | Optional default icon. |
id | string | Optional unique identifier. |
hideSelectedLabel | boolean | Whether to hide the label of the selected option. Default: false. |
className | string | Optional CSS class name. |
SelectOption Interface
| Property | Type | Description |
|---|---|---|
value | string | IDs unique value of the option. |
label | string | Display label (optional, defaults to value if not provided). |
icon | string | Optional Iconify icon name. |
onClick | () => void | Optional specific click handler for this option. |
JSON Data Example
{
"type": "Select",
"data": {
"id": "select-basic",
"placeholder": "Choose an option",
"defaultValue": "option2",
"options": [
{
"value": "option1",
"label": "Option 1"
},
{
"value": "option2",
"label": "Option 2"
},
{
"value": "option3",
"label": "Option 3"
}
]
}
}