Appearance
RadioGroup
A vertical list of radio buttons, each with a label and optional description, built on reka-ui's RadioGroup. Use it when the options need explaining or there are more than a handful; for two to four short labels a ToggleGroup is more compact, and for long lists use a SelectBox.
Examples
Basic
v-model holds the selected value. Arrow keys move the selection between enabled options.
Model type
Adds an exposed stage before infectiousness
Requires the local server
vue
<script setup>
import { ref } from "vue";
const modelType = ref("sir");
</script>
<RadioGroup
v-model="modelType"
label="Model type"
hint="Compartmental models run in the browser"
:options="[
{ value: 'sir', label: 'SIR' },
{
value: 'seir',
label: 'SEIR',
description: 'Adds an exposed stage before infectiousness',
},
{
value: 'agent',
label: 'Agent-based',
description: 'Requires the local server',
disabled: true,
},
]"
/>Horizontal
Output interval
vue
<RadioGroup
v-model="output"
label="Output interval"
orientation="horizontal"
:options="[
{ value: 'daily', label: 'Daily' },
{ value: 'weekly', label: 'Weekly' },
{ value: 'monthly', label: 'Monthly' },
]"
/>Model
| Name | Type |
|---|---|
v-model | string |
Props
| Prop | Type | Required | Default |
|---|---|---|---|
label | string | No | — |
hideLabel | boolean | No | — |
ariaLabel | string | No | — |
hint | string | No | — |
options | RadioOption[] | Yes | — |
disabled | boolean | No | — |
orientation | "vertical" | "horizontal" | No | "vertical" |