Skip to content

Radio API Reference ​

Props ​

PropTypeDefaultDescription
sizeString'sm'Visual size of the control. Options: 'xs', 'sm', 'md', 'lg', 'xl'.
disabledBooleanfalsePrevents user interaction and lowers opacity.
readonlyBooleanfalseBlocks value changes while keeping the normal appearance.
toggleBooleanfalseAllows deselecting the radio when it’s already selected.
labelString''Text shown next to the radio when not using the label slot.
valueString / Number / BooleanRequiredPrimitive emitted when this option is selected.
multipleBooleanfalseTreats the selection as an array, allowing checkbox-like behavior.
modelValueString / Number / Boolean / Array'' or []Bound value (use v-model). Defaults to an empty string (single) or empty array (multiple).
selectedString / Number / Boolean / Array'' or []Secondary controlled value, used when modelValue isn’t provided.
valueComparatorFunction(a, b, multiple) => multiple ? Array.isArray(a) && a.includes(b) : a === bComparison helper for complex values.
variantString'default'Applies themed styles such as 'default' or 'success'.

Events ​

EventPayloadDescription
update:modelValuenewValueFires whenever the selection changes.
change(newValue, toggledValue, event)Emits alongside update:modelValue with the clicked value and DOM event.

Slots ​

SlotPropsDescription
icon{ isChecked }Replace the default circle indicator.
label{ isChecked }Replace the inline label content.

Example Usage ​

Basic Single Selection ​

vue
<template>
  <ORadio
    v-model="contactMethod"
    label="Email updates"
    value="email"
  />
</template>

<script setup>
import { ref } from 'vue';
import { ORadio } from 'your-component-library';

const contactMethod = ref('email');
</script>

Multiple Selection & Toggle ​

vue
<template>
  <div class="toppings">
    <ORadio
      v-for="option in toppingOptions"
      :key="option.value"
      v-model="selectedToppings"
      :label="option.label"
      :value="option.value"
      :multiple="true"
      :toggle="true"
    />
  </div>
</template>

<script setup>
import { ref } from 'vue';
import { ORadio } from 'your-component-library';

const toppingOptions = [
  { label: 'Cheese', value: 'cheese' },
  { label: 'Pepperoni', value: 'pepperoni' },
  { label: 'Mushrooms', value: 'mushrooms' },
];

const selectedToppings = ref(['cheese']);
</script>