Skip to content

Select โ€‹

A dropdown picker built on a custom button + listbox UI. Sizes, color and visual variants, validation states, slot-overridable label/helper/prefix/suffix, and a clearable trigger. Toggle Vue / CSS to switch the live demo and source together.

Basic โ€‹

Default select with label, placeholder and helper text.

Vue SFC

Sizes โ€‹

Small, medium and large.

Vue SFC

Variants โ€‹

outlined, filled and underlined.

Vue SFC

Colors โ€‹

All built-in color variants.

Vue SFC

States โ€‹

Disabled, readonly and required.

Vue SFC

Validation โ€‹

valid, invalid and warning states with messages.

Vue SFC

Clearable โ€‹

Clear button shown when a value is selected.

Vue SFC

Slots โ€‹

Custom label, helper and prefix/suffix content via slots.

Vue SFC

Event: change โ€‹

Listen to mno-change to react to selection.

Vue SFC

Event log โ€‹

Live log of mno-change and mno-clear events.

Vue SFC

Customized โ€‹

Override per-element styling with cssClass (Vue) or utility classes (CSS).

Vue SFC

Custom keys โ€‹

Use key-value and display-value to feed natural-shape items (for example { id, name }) without pre-mapping. key-value names the property stored in modelValue; omit it to store the whole item object. display-value is either a property name (string) or a (item) => string function โ€” when unset it falls back to item.label.

Vue SFC

DataSource (devextreme) โ€‹

Bind a live devextreme DataSource with :data-source.prop. The select reads its items and stays reactive to the source's events โ€” so an external ds.filter(...) + ds.load() updates the list with no re-binding. With load-more="scroll" it pages the source one chunk at a time (here pageSize: 5). This example builds the source with mono-utils' monoCreateFetcher against a public OData endpoint (baseUrl, no configBaseUrl). Bind with .prop and use key-value / display-value to map the server fields.

Add searchable to put a search box at the top of the dropdown. With a bound DataSource, typing queries the server (debounced) so the dropdown shows the full matching result set โ€” and load-more="scroll" pages those filtered results; search-value names the field(s) to search ("Nama,Code" or :search-value.prop="['Nama','Code']", falling back to display-value/key-value). With a plain items array it filters client-side. search-operation (default contains), search-debounce (default 300ms) and search-placeholder tune it.

Grouped options โ€‹

display-group is an array with one accessor per level โ€” a string reads a field off the row, a function receives the row (:display-group.prop="['Nama', (row) => row.Code]") โ€” used as both the group key and the header label. Selection, key-value and display-value work as usual on the leaf rows. There are two ways to feed it:

group (recommended for a DataSource). Pass a plain, paginated source โ€” no group in its request, so paging stays on โ€” and add the boolean group prop. mono-select fetches flat rows page by page (so load-more="scroll" / "button" keep working) and buckets the accumulated rows by display-group in the browser. Scroll the dropdown to load more โ€” groups grow in place; each request is a normal $skip/$top page (never $apply=groupby). Add group-sticky to pin each group header to the top while its rows scroll past (nested levels stack):

group also works on a static array โ€” 1,200 records generated with map, grouped two levels (team โ†’ role) with sticky headers; load-more="scroll" reveals a chunk at a time so the big list never renders all at once:

Pre-grouped data. If your data is already nested as { key, items }, omit group and the component renders it directly. group-key / group-items name the key and child-array fields (default 'key' / 'items'; camelCase forms too). This static array uses custom group-key="k" / group-items="rows":

Width & height โ€‹

Set width, height, min-width, max-width, min-height or max-height โ€” each takes a CSS string ("260px", "80%") or a number (px). This sizes the field (distinct from dropdownHeight/dropdownMaxHeight, which size the popup).

Vue SFC

Types โ€‹

Importimport { SelectProps } from 'mono-helper'
PropValueDefaultDescription
modelValueunknownโ€”The currently selected value.
valueunknownโ€”Alias for the selected value, kept in sync with modelValue.
itemsstring | SelectItem[][]List of selectable items, as an array or JSON string.
dataSourceSelectDataSource<SelectItem>โ€”DataSource used to drive the item list, taking precedence over items.
immediatebooleantrueAuto-load the DataSource on attach when it has no items yet.
loadMore'' | 'button' | 'scroll' | booleanโ€”Incremental loading mode: scroll, button, or off.
pageSizenumber10Chunk size used when paging a plain items array.
keyValuestring''Item property name used as the model value.
displayValuestring | (item: SelectItem) => string''Item property name or function used to derive display text.
displayGroupSelectDisplayGroup[]Per-level accessors for grouped options (header label per group level).
groupKeystring'key'Field holding a group node's key (default 'key').
groupItemsstring'items'Field holding a group node's child array (default 'items').
searchablebooleanfalseTurn the field itself into a search input (combobox); server query when a DataSource is bound.
searchValuestring | string[]''Field(s) the search matches (server `searchExpr` + client filter target).
searchOperationstring'contains'devextreme search operation for server search (default 'contains').
searchDebouncenumber300Debounce (ms) before a server search fires (default 300).
searchPlaceholderstring''Placeholder shown in the field while it is open/searching (falls back to `placeholder`).
groupbooleanfalseGroup a plain, paginated DataSource client-side (keeps scroll/load-more).
groupStickybooleanfalseKeep group headers pinned to the top while their rows scroll.
dropdownHeightstring | number''Fixed height of the scrollable dropdown list.
dropdownMaxHeightstring | number''Maximum height of the scrollable dropdown list.
size'sm' | 'md' | 'lg''md'Visual size of the select.
color'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info''primary'Color theme applied to the select.
variant'underlined' | 'outlined' | 'filled''outlined'Visual style variant of the select.
labelstring''Text label shown above the select.
placeholderstring'Select option'Placeholder text shown when no value is selected.
helperTextstring''Helper text shown below the select.
validationState'warning' | 'default' | 'valid' | 'invalid''default'Validation state controlling the select's appearance.
validationMessagestring''Validation message shown below the select.
errorMessagestring''Error message shown below the select.
successMessagestring''Success message shown below the select.
namestring''Form field name submitted with the value.
disabledbooleanfalseDisables the select, preventing interaction.
readonlybooleanfalseMakes the select read-only, blocking value changes.
requiredbooleanfalseMarks the select as required and shows a required indicator.
clearablebooleanfalseShows a clear button to reset the selected value.
ariaLabelTextstringโ€”Accessible label used when no visible label is present.
ariaLabelstringโ€”โ€”
widthstring | numberโ€”Explicit sizing of the field. Each accepts a CSS length string (`"320px"`, `"80%"`) or a number (interpreted as px). Use `width="100%"` for full width. (Distinct from `dropdownHeight`/`dropdownMaxHeight`, which size the popup.)
heightstring | numberโ€”โ€”
minWidthstring | numberโ€”โ€”
maxWidthstring | numberโ€”โ€”
minHeightstring | numberโ€”โ€”
maxHeightstring | numberโ€”โ€”
cssClassSelectCssClass{}Custom CSS classes applied to internal select parts.