Skip to content

Select

Single string selection. Supply a visible label. Disabled options are unavailable to keyboard and pointer input.

Preview

Open in the playground

Usage

SelectExample.vueVue / TS
<script setup lang="ts">
import { ref } from 'vue'
import { FzSelect } from '@chrisdalbano/forza-ui'
import type { ForzaOption } from '@chrisdalbano/forza-ui'
const role = ref<string>('guardian')
const roles: ForzaOption[] = [{ value: 'guardian', label: 'Guardian' }]
</script>

<template>
  <FzSelect v-model="role" label="Role" :options="roles" />
</template>
TypeScript exampleSource you can use.

Import the shared stylesheet once and wrap your app in .fz-theme. See installation.

Props

NameTypeRequiredDefault
labelstringYesNone
optionsreadonly ForzaOption[]YesNone
placeholderstring | undefinedNo"Choose an option"
disabledboolean | undefinedNoNone
namestring | undefinedNoNone
modelValuestringYesNone

Events and state

v-model: string

  • update:modelValue: [value: string]

Slots

none

Add from source

sh
forza add select

Set up the CLI first. Generated API tables come from the Vue source, using Vue Language Tools.

Released under the MIT License. Independent work.