Component

Radio group

<dom-radio-group>

A single-choice form control with roving focus and fully styleable options.

Playground

Try every prop live

Radio group playground

Use this when one option in a set must be selected.

Playground.vuevue
<script setup>
import { reactive } from 'vue';
import { DomRadioGroup } from '@getdom/studio/vue';

const data = reactive({
	  "modelValue": "team",
	  "id": "",
	  "name": "",
	  "label": "Plan",
	  "description": "",
	  "placeholder": "",
	  "required": false,
	  "disabled": false,
	  "readOnly": false,
	  "invalid": false,
	  "errors": {},
	  "visible": true,
	  "validators": [],
	  "validateOnBlur": true,
	  "chrome": "field",
	  "options": [
	    {
	      "value": "solo",
	      "label": "Solo"
	    },
	    {
	      "value": "team",
	      "label": "Team"
	    },
	    {
	      "value": "enterprise",
	      "label": "Enterprise"
	    }
	  ],
	  "orientation": "vertical"
	});
</script>

<template>
	<DomRadioGroup
		v-bind="data"
		@update:modelValue="data.modelValue = $event"
	/>
</template>

Demo

Plans

Radio groups work well for small, mutually exclusive option sets.

Selected value: team

Plans.vuevue
<script setup>
import { ref } from 'vue';
import { DomRadioGroup } from '@getdom/studio/vue';

const plan = ref('team');
const options = [
	{ value: 'solo', label: 'Solo' },
	{ value: 'team', label: 'Team' },
	{ value: 'enterprise', label: 'Enterprise' },
];
</script>

<template>
	<div class="grid w-full max-w-md gap-3">
		<DomRadioGroup v-model="plan" :options="options" label="Plan" />
		<p class="text-xs text-muted-fg">Selected value: <code class="text-fg">{{ plan }}</code></p>
	</div>
</template>

Reference

Props

Control props

NameTypeTSDefaultDescription
modelValuestring | numberstring''Selected value.
options*
[
	{
		label: "Option 1",
		value: "option-1",
	}
]
arrayArray<OptionsItem
type OptionsItem = {
	label?: string; // Label
	value?: string; // Value
};
>
Radio options.
orientation'vertical' | 'horizontal'string'vertical'Arrow key direction.

Field props

NameTypeTSDefaultDescription
idstringstring''Optional ID override. By default parent forms derive the input ID from the field path using underscores.
namestringstring''Local field name. Parent forms derive the full field path and native HTML name from the form hierarchy.
labelstringstring''Visible field label.
descriptionstringstring''Optional helper copy below the field.
placeholderstringstring''Placeholder shown when the control is empty.
requiredbooleanbooleanfalseMark the field as required.
disabledbooleanbooleanfalseDisable field interaction.
readOnlybooleanbooleanfalseShow the value but prevent editing.
invalidbooleanbooleanfalseMark the field invalid.
errors
[
	{
		name: "Validation name",
		message: "Error message",
	}
]
array | object | stringArray<ErrorsItem
type ErrorsItem = {
	name?: string; // Name
	message?: string; // Message
};
>
{}Validation errors for this field.
visiblebooleanbooleantrueShow or hide the field.
validatorsarrayArray<unknown>[]Validators attached to this field. Use functions in Vue code, or serializable records such as { name: "minLength", props: { min: 2 } } in generated schemas.
validateOnBlurbooleanbooleantrueRun validators when the field loses focus.
chrome'field' | falsestring'field'Render default field chrome, or false to render only the control while keeping form state wiring.

Auto-generated from Radio group.props and inline _edit hints.

Events

NamePayloadDescription
@update:modelValue(value
value: string;
: string)
Emitted when selection changes.
@focus
@blur

Names auto-detected from defineEmits and source emit() calls; payload and description from __doc.events when present.