Skip to content

RadioGroup

Wraps multiple Radio components, providing shared name and value context via provide/inject. Emits a single update:modelValue when any child is selected.

Basic usage

Selected: morning

Tailwind v4
vue
<script setup>
import { ref } from 'vue'
const shift = ref('morning')
</script>

<template>
  <RadioGroup v-model="shift" label="Shift" name="shift-group">
    <Radio value="morning" label="Morning (6 AM)" />
    <Radio value="afternoon" label="Afternoon (2 PM)" />
    <Radio value="night" label="Night (10 PM)" />
  </RadioGroup>
</template>

No pre-selection

Tailwind v4
vue
<RadioGroup v-model="size" label="T-shirt size">
  <Radio value="sm" label="Small" />
  <Radio value="md" label="Medium" />
  <Radio value="lg" label="Large" />
  <Radio value="xl" label="X-Large" />
</RadioGroup>

Disabled group

Tailwind v4
vue
<RadioGroup v-model="val" label="Options (disabled)" disabled>
  <Radio value="a" label="Option A" />
  <Radio value="b" label="Option B" />
</RadioGroup>

Props

PropTypeDefaultDescription
modelValuestringCurrently selected value
namestringShared name attribute passed to all child Radio inputs
disabledbooleanfalseDisables all child Radio components
labelstringGroup label rendered above the options

Emits

EventPayloadDescription
update:modelValuestringValue of the newly selected radio

Slots

SlotDescription
defaultRadio components

Private — Jetpack Labs internal use only