MigsLab UIVue 3 component workshop

Form

Dropdown

Select one option from a list. Below the native breakpoint (768px by default) it switches to the browser's native <select> for better mobile behavior.

import { DropdownComponent, type SelectOption } from '@/MigsLab/shared'

Example

Selected: —
const selectedFruit = ref<OptionValue>()

const fruitOptions: SelectOption[] = [
  { label: 'Apple', value: 'apple' },
  { label: 'Durian (sold out)', value: 'durian', disabled: true }
]

<DropdownComponent v-model="selectedFruit" :options="fruitOptions" placeholder="Pick a fruit" />

Text only

Renders as inline text with a chevron — useful for view or form selectors in headers.

<DropdownComponent v-model="view" :options="viewOptions" text-only text-size="1.15rem" />

API

Props

NameType Default Description
v-modelstring | numberundefinedValue of the selected option.
optionsSelectOption[]—Options as { label, value, disabled? }.
placeholderstring'Select...'Shown when nothing is selected.
textOnlybooleanfalseRender the toggle as plain text.
textSizestringundefinedCSS font-size of the toggle, e.g. 1.15rem.
disabledbooleanfalseDisable the control.
nativeBreakpointnumber768Window width (px) at or below which the native <select> is used. Set 0 to always use the custom menu.