Skip to content

Select

Display a select field.

Usage

The Select component is a wrapper around the native select HTML element. For more advanced use cases like searching or multiple selection, consider using the SelectMenu component.

Use a v-model to make the Select reactive alongside the options prop to pass an array of strings or objects.

vue
<script setup>
import {ref} from 'vue'

const countries = ['United States', 'Canada', 'Mexico']

const country = ref(countries[0])
</script>

<template>
  <s-select v-model="country" :options="countries"/>
</template>

Released under the MIT License.