Select
You can use the Select
component to render a select input. This component is for single and multiple select inputs.
By default has enabled searchable
, clearable
and autoselect
options.
Prop | Type | Default | Description |
---|---|---|---|
name | string | - | The name of the field. |
label | string | undefined | null | null | The label of the field. |
placeholder | string | undefined | null | "" | The placeholder of the field. |
context | string | ”form” | The context of the form. |
id | string | undefined | null | null | The id of the field. |
autoselect | boolean | undefined | true | Enable or disable the autoselect option. |
searchable | boolean | undefined | true | Enable or disable the searchable option. |
clearable | boolean | undefined | true | Enable or disable the clearable action. |
multiple | boolean | undefined | false | Enable or disable multiple select. |
disabled | boolean | undefined | false | Enable or disable the field. |
options | SelectOption [] | [] | The options of the field. |
styles | SelectStyles | {} | The styles of the field. |
clearOnDestroy | boolean | undefined | false | Clear the field value when the component is destroyed. |
Slot | Prop | Description | Available to |
---|---|---|---|
default | - | Customize the label of the field. | all |
item | { item: SelectOption } | Customize the item selected. | multiple |
remove | - | Customize the remove icon. | multiple |
clear | - | Customize the clear icon. | all |
arrow | - | Customize the arrow icon. | all |
option | { option: SelectOption ; selected: boolean; } | Customize the option of the field. | all |
empty | - | Customize the empty message. | all |
error | { error: string | null } | Show an error message. | all |
Name | Type | Description |
---|---|---|
choose | (option: SelectOption ) => void | The event emitted when the user selects an option. |
remove | (option: SelectOption ) => void | The event emitted when the user removes an item. |
clear | () => void | The event emitted when the user clears the field. |