Skip to content

Radio ​

Radio button for single selection from a list of options.

apple
vue
<script setup>
const value = ref('apple')
</script>

<template>
  <VxRadioGroup v-model="value">
    <VxRadio value="apple" label="Apple" />
    <VxRadio value="banana" label="Banana" />
    <VxRadio value="cherry" label="Cherry" />
  </VxRadioGroup>
</template>

Options Prop ​

Pass options as an array instead of individual radio components.

apple
vue
<script setup>
const options = [
  { label: 'Apple', value: 'apple' },
  { label: 'Banana', value: 'banana' },
  { label: 'Dragonfruit', value: 'dragonfruit', disabled: true },
]
</script>

<template>
  <VxRadioGroup v-model="value" :options="options" />
</template>

Horizontal ​

medium
vue
<template>
  <VxRadioGroup v-model="value" direction="horizontal">
    <VxRadio value="small" label="Small" />
    <VxRadio value="medium" label="Medium" />
    <VxRadio value="large" label="Large" />
  </VxRadioGroup>
</template>

With Description ​

card
vue
<script setup>
const plans = [
  { label: 'Free', value: 'free', description: 'Up to 3 projects' },
  { label: 'Pro', value: 'pro', description: 'Unlimited projects' },
  { label: 'Enterprise', value: 'enterprise', description: 'Custom solutions' },
]
</script>

<template>
  <VxRadioGroup v-model="value" :options="plans" />
</template>

Shipping Example ​

standard
vue
<template>
  <VxRadioGroup v-model="value" :options="shipping" />
</template>

Sizes ​

sm
default
lg
vue
<template>
  <VxRadioGroup size="sm">...</VxRadioGroup>
  <VxRadioGroup>...</VxRadioGroup>
  <VxRadioGroup size="lg">...</VxRadioGroup>
</template>

Disabled ​

vue
<template>
  <VxRadioGroup v-model="value" disabled>...</VxRadioGroup>
</template>

Individual Disabled ​

monthly
vue
<template>
  <VxRadioGroup v-model="value">
    <VxRadio value="monthly" label="Monthly" />
    <VxRadio value="lifetime" label="Lifetime" disabled />
  </VxRadioGroup>
</template>

Custom Content ​

email
vue
<template>
  <VxRadioGroup v-model="value" direction="horizontal">
    <VxRadio value="email"><MailIcon /> Email</VxRadio>
    <VxRadio value="phone"><PhoneIcon /> Phone</VxRadio>
  </VxRadioGroup>
</template>

Bordered Radio ​

Card-style radio with border, highlighted when selected.

Default
Large
Small
Disabled
vue
<template>
  <VxRadioGroup v-model="value" direction="horizontal" bordered>
    <VxRadio value="a" label="Option A" />
    <VxRadio value="b" label="Option B" />
  </VxRadioGroup>
</template>

Bordered with Description ​

a
vue
<template>
  <VxRadioGroup v-model="value" bordered>
    <VxRadio value="free" label="Free" description="Up to 3 projects" />
    <VxRadio value="pro" label="Pro" description="Unlimited projects" />
  </VxRadioGroup>
</template>

Bordered Horizontal ​

vue
<template>
  <VxRadioGroup v-model="value" direction="horizontal" bordered>
    <VxRadio value="monthly" label="Monthly" description="$9/mo" />
    <VxRadio value="yearly" label="Yearly" description="$89/yr" />
  </VxRadioGroup>
</template>

Radio Buttons ​

Button-style radio with connected borders, like a segmented control.

left
vue
<template>
  <VxRadioButtonGroup v-model="value">
    <VxRadioButton value="left">Left</VxRadioButton>
    <VxRadioButton value="center">Center</VxRadioButton>
    <VxRadioButton value="right">Right</VxRadioButton>
  </VxRadioButtonGroup>
</template>

Button Group with Options ​

monthly
vue
<script setup>
const options = [
  { label: 'Monthly', value: 'monthly' },
  { label: 'Yearly', value: 'yearly' },
  { label: 'Lifetime', value: 'lifetime', disabled: true },
]
</script>

<template>
  <VxRadioButtonGroup v-model="value" :options="options" />
</template>

Button Group with Icons ​

list
vue
<template>
  <VxRadioButtonGroup v-model="value">
    <VxRadioButton value="grid"><GridIcon /></VxRadioButton>
    <VxRadioButton value="list"><ListIcon /></VxRadioButton>
  </VxRadioButtonGroup>
</template>

Button Sizes ​

vue
<template>
  <VxRadioButtonGroup size="sm">...</VxRadioButtonGroup>
  <VxRadioButtonGroup>...</VxRadioButtonGroup>
  <VxRadioButtonGroup size="lg">...</VxRadioButtonGroup>
</template>

Custom Button Style ​

Use button-class and button-style on the group to change height, border-radius, etc.

Pill shape, tall
Square, compact
Rounded 8px
vue
<template>
  <!-- Pill -->
  <VxRadioButtonGroup :button-style="{ height: '44px', borderRadius: '22px', padding: '0 24px' }">
    ...
  </VxRadioButtonGroup>

  <!-- Square -->
  <VxRadioButtonGroup :button-style="{ height: '28px', borderRadius: '0' }">
    ...
  </VxRadioButtonGroup>

  <!-- Custom class -->
  <VxRadioButtonGroup button-class="my-custom-btn">
    ...
  </VxRadioButtonGroup>
</template>

Button Disabled ​

vue
<template>
  <VxRadioButtonGroup v-model="value" disabled>...</VxRadioButtonGroup>
</template>

Custom Color ​

vue
<template>
  <VxRadioGroup color="#3b82f6">
    <VxRadio value="a" color="#22c55e" label="Custom per-item" />
  </VxRadioGroup>
</template>

Card Variant ​

Full clickable card style with highlighted background.

pro
vue
<template>
  <VxRadioGroup v-model="value" variant="card" direction="horizontal">
    <VxRadio value="free" label="Free" description="$0/mo" />
    <VxRadio value="pro" label="Pro" description="$19/mo" />
  </VxRadioGroup>
</template>

List Variant ​

List style with dividers between items.

email
vue
<template>
  <VxRadioGroup v-model="value" variant="list">
    <VxRadio value="email" label="Email" />
    <VxRadio value="sms" label="SMS" />
  </VxRadioGroup>
</template>

Grid Columns ​

a
vue
<template>
  <VxRadioGroup v-model="value" :columns="3" bordered gap="8px">
    ...
  </VxRadioGroup>
</template>

Block Buttons (Full Width) ​

vue
<template>
  <VxRadioButtonGroup v-model="value" block>...</VxRadioButtonGroup>
</template>

Equal Width Buttons ​

vue
<template>
  <VxRadioButtonGroup v-model="value" equal>...</VxRadioButtonGroup>
</template>

Readonly ​

Shows selected value but prevents changing.

vue
<template>
  <VxRadioGroup v-model="value" readonly>...</VxRadioGroup>
</template>

Loading ​

Spinner on the checked radio.

vue
<template>
  <VxRadio value="processing" label="Processing..." loading />
</template>

VxRadio Props ​

PropTypeDefaultDescription
modelValuestring | number | boolean—Bound value (v-model, or inherited from group)
valuestring | number | boolean—This radio's value
labelstring''Label text
descriptionstring''Description below label
disabledbooleanfalseDisable
readonlybooleanfalseShow but prevent change
size'sm' | 'default' | 'lg''default'Size
namestring''Input name attribute
borderedbooleanfalseCard border style
colorstring''Custom checked color
loadingbooleanfalseShow spinner when checked

VxRadioGroup Props ​

PropTypeDefaultDescription
modelValuestring | number | boolean—Selected value (v-model)
optionsRadioOption[]—Options array
disabledbooleanfalseDisable all
readonlybooleanfalseRead only
size'sm' | 'default' | 'lg''default'Size
direction'horizontal' | 'vertical''vertical'Layout
variant'default' | 'card' | 'list''default'Visual variant
borderedbooleanfalseBorder style
colorstring''Custom checked color
columnsnumber0Grid columns (0=flex)
gapstring''Custom gap
blockbooleanfalseFull-width children
equalbooleanfalseEqual-width children
requiredbooleanfalsearia-required
namestring''Input name

Events ​

ComponentEventDescription
VxRadioGroupupdate:modelValueSelection changed
VxRadioGroupchangeSelection changed

Slots ​

ComponentSlotDescription
VxRadiodefaultCustom label content
VxRadiodescriptionCustom description