Skip to content

PrimeSelectButton

A FormKit wrapper for PrimeVue's SelectButton component.

Live Example on Website

Usage

vue
<FormKit type="primeselectbutton" :options="options" option-label="label" option-value="value" v-model="selected" />

Object-based Example

vue
<script setup>
const selectOptions = [
  { label: 'yes', value: 'YES' },
  { label: 'no', value: 'NO' },
  { label: 'maybe', value: 'MAYBE' },
]
const selectOptions2 = [
  { label: 'Email', value: 'mail' },
  { label: 'Phone', value: 'phone' },
  { label: 'Chat', value: 'chat' },
]
const schema = [
  { $formkit: 'primeSelectButton', label: 'SelectButton', name: 'selectButton', options: selectOptions, optionLabel: 'label', optionValue: 'value', value: 'MAYBE', unselectable: false },
  { $formkit: 'primeSelectButton', label: 'Contact options', name: 'selectButtonMultiple', optionLabel: 'label', optionValue: 'value', options: selectOptions2, multiple: true },
]
const data = {}
</script>

<template>
  <FormKit :schema="schema" :data="data" />
</template>

Props

NameTypeDescription
optionsarrayList of options
optionLabelstringField for label
optionValuestringField for value
optionDisabledbooleanDisable option
multiplebooleanEnable multiple selection
dataKeystringUnique key for options
ptobjectPass-through options
ptOptionsobjectPass-through options
unstyledbooleanDisable default styles
sizestringInput size
......See PrimeVue docs for all props

See PrimeVue SelectButton docs for more details.

FormKit PrimeVue Module