`ComboBox` combines a text input with a dropdown menu to let users select from predefined options or enter custom values. It supports filtering, custom item rendering, and various states. `ComboBox` is keyed for performance reasons.
Every items object must have a unique "id" property.
## Default Create a combobox with a title and placeholder text. Each item requires a unique `id` and `text`. ## Custom slot Override the default slot to customize how each item displays. Access the item and index through the `let:` directive. ## Hidden label Set `hideLabel` to `true` to visually hide the label while keeping it accessible to screen readers. ## Initial selected id Set `selectedId` to pre-select an item when the combobox loads. ## Reactive example See how the combobox responds to user input and selection changes. ## Clear selection Use `bind:this` to access the component instance and call `ComboBox.clear()` to programmatically clear the selection. Set `focus: false` in the method options to prevent re-focusing the input. ## Multiple combo boxes See how to manage multiple comboboxes in a form. ## Filterable Enable filtering to let users search through the options. ## Filterable with custom label Set `itemToString` to customize how items display in the filterable combobox. ## Top direction Set `direction` to `"top"` to make the dropdown menu appear above the input. ## Light variant Set `light` to `true` to use the light color scheme. ## Extra-large size Set `size` to `"xl"` for an extra-large combobox. ## Small size Set `size` to `"sm"` for a small combobox. ## Invalid state Set `invalid` to `true` and provide `invalidText` to show an error message. ## Warning state Set `warn` to `true` and provide `warnText` to show a warning message. ## Disabled state Set `disabled` to `true` to prevent interaction with the combobox. ## Disabled items Set `disabled: true` in an item object to disable specific options.