Skip to content

SelectListField

A single-select or multi-select field backed by a searchable dropdown. Wraps vue-select with Praxis styling and an optional required label.

Usage

vue
<script setup>
import { ref } from 'vue'
import { SelectListField } from 'praxis-vue-ui'

const options = ['Option A', 'Option B', 'Option C']
const selected = ref(null)
</script>

<template>
  <SelectListField
    v-model="selected"
    :options="options"
    label="Category"
    :required="true"
  />
</template>

Props

PropTypeDefaultDescription
modelValueunknownnullCurrently selected value. Use with v-model.
optionsrequiredunknown[]Array of options to display in the dropdown.
labelstring'name'Property name to use as display label for object options.
placeholderstring''Placeholder text shown when no option is selected.
requiredbooleanfalseShows required asterisk on the label.
disabledbooleanfalseDisables the dropdown.
multiplebooleanfalseEnables multi-select mode.
reduce(option) => unknownundefinedFunction to extract the emitted value from a selected option object.

Emits

EventPayloadDescription
update:modelValueunknownEmitted on selection change.

Built with VitePress