FormRadioButton
A FormKit wrapper for OpenVue's RadioButton component.
Usage
vue
<FormKit type="formRadioButton" :options="options" option-label="label" option-value="value" v-model="selected" />Object-based Example
vue
<script setup>
const schema = [
{
$formkit: 'formRadioButton',
id: 'basic',
label: 'Select',
name: 'basic',
optionLabel: 'label',
optionValue: 'value',
options: [
{ label: 'Every page load', value: 'refresh' },
{ label: 'Every hour', value: 'hourly' },
{ label: 'Every day', value: 'daily' },
]
},
{
$formkit: 'formRadioButton',
id: 'answer',
label: 'Select Answer',
name: 'answer',
optionLabel: 'label',
optionValue: 'value',
options: [
{ label: 'A', value: 'A' },
{ label: 'B', value: 'B' },
{ label: 'C', value: 'C' },
{ label: 'D', value: 'D' },
{ label: 'E', value: 'E' },
]
},
]
const data = { basic: 'refresh' }
</script>
<template>
<FormKit :schema="schema" :data="data" />
</template>Props
| Name | Type | Description |
|---|---|---|
| options | array | List of options |
| optionLabel | string | Field for label |
| optionValue | string | Field for value |
| pt | object | Pass-through options |
| ptOptions | object | Pass-through options |
| unstyled | boolean | Disable default styles |
| size | string | Input size |
| ... | ... | See OpenVue docs for all props |
See OpenVue RadioButton docs for more details.