MtSelect component provides a searchable dropdown for selecting one or multiple items from a list.
Import
Props
An array of objects with the labelProperty and valueProperty.
Dependent on multiSelection, either a single value or an array of values.
Toggles if either one or more items can be selected.
The object key of the label property. Can be a single string or array of strings.
The object key to use for the value.
The number of items that are expanded by default.
The label for the select field itself.
The placeholder for the select field.
Determines if the placeholder should be shown even when there are selections.
Toggles the loading state of the select field.
Disables or enables the select field.
Toggles a button to clear all selections.
Determines whether to highlight the searched term.
Used to implement a custom search function. Receives
{ options, labelProperty, valueProperty, searchTerm }.An error in your business logic related to this field.
Render the select field in small size without a search input.
Toggles the inheritance visualization.
Determines if the field is inheritable.
Events
Emitted when the selected value(s) change.
Emitted when an item is added to selection.
Emitted when an item is removed from selection.
Emitted when the search term changes.
Emitted when the value limit is expanded.
Emitted when scrolling to bottom of results.
Slots
Content before the selection.
Content after the selection.
Additional hint content.
Custom template for result items. Receives item, index, and helper functions.
Custom template for result item labels.
Custom template for selected item labels.
Content before the item list.
Content after the item list.
Usage
Basic Select
Multi-Select
With Search
Custom Search Function
Custom Result Template
Small Select
Accessibility
- Keyboard navigation (arrow keys, enter to select)
- Escape key closes dropdown
- Screen reader support with ARIA attributes
- Focus management within dropdown
- Selected items announced to screen readers
- Search input accessible