Radio
About 189 wordsLess than 1 minute
Radio
Props
| Prop | Type | Default | Description |
|---|---|---|---|
id | string | Auto-generated | Unique base ID used for each radio input. |
icon | string | null | null | Optional icon displayed with the fieldset label. |
label | string | - | Main label for the group of radio options. |
info | string | - | Optional helper text shown below the radio group. |
error | string | - | Error message shown below the radio group. |
options | Option[] | [] | List of selectable options with { value, label, disabled? }. |
modelValue | string | number | undefined | null | The current selected value (must match one of the option values). |
Emits
| Event | Payload Type | Description |
|---|---|---|
update:modelValue | string | number | Emitted when a new option is selected. |
Install
import { FgRadio } from 'fadgram-vue'
Basic usage
Preview
Selected country:
vue
<fg-radio
v-model="country"
label="Select country"
:options="[
{
label: 'United states',
value: 'us',
},
{
label: 'United kingdom',
value: 'uk',
},
{
label: 'Germany',
value: 'germany',
},
]"
/>
