Skip to content

Radio ​

Variantlar roʻyxatidan bittani tanlash uchun radio tugma.

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 ​

Alohida radio komponentlari oʻrniga variantlarni massiv sifatida uzating.

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 ​

Chegaraga ega karta uslubidagi radio, tanlanganda ajratib koʻrsatiladi.

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 ​

Segmented control kabi, bogʻlangan chegaralarga ega tugma uslubidagi radio.

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 ​

Balandlik, border-radius va boshqalarni oʻzgartirish uchun guruhda button-class va button-style dan foydalaning.

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 ​

Ajratib koʻrsatilgan fonli, toʻliq bosiladigan karta uslubi.

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 ​

Elementlar orasida ajratkichli roʻyxat uslubi.

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 ​

Tanlangan qiymatni koʻrsatadi, lekin oʻzgartirishning oldini oladi.

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

Loading ​

Belgilangan radio ustida spinner.

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

VxRadio Props ​

PropTypeDefaultDescription
modelValuestring | number | boolean—Bogʻlangan qiymat (v-model yoki guruhdan meros)
valuestring | number | boolean—Ushbu radio qiymati
labelstring''Label matni
descriptionstring''Label ostidagi tavsif
disabledbooleanfalseOʻchirish
readonlybooleanfalseKoʻrsatish, lekin oʻzgartirishga yoʻl qoʻymaslik
size'sm' | 'default' | 'lg''default'Oʻlcham
namestring''Input name atributi
borderedbooleanfalseKarta chegara uslubi
colorstring''Maxsus tanlangan rang
loadingbooleanfalseBelgilanganda spinner koʻrsatish

VxRadioGroup Props ​

PropTypeDefaultDescription
modelValuestring | number | boolean—Tanlangan qiymat (v-model)
optionsRadioOption[]—Variantlar massivi
disabledbooleanfalseHammasini oʻchirish
readonlybooleanfalseFaqat oʻqish
size'sm' | 'default' | 'lg''default'Oʻlcham
direction'horizontal' | 'vertical''vertical'Joylashuv
variant'default' | 'card' | 'list''default'Vizual variant
borderedbooleanfalseChegara uslubi
colorstring''Maxsus tanlangan rang
columnsnumber0Grid ustunlari (0=flex)
gapstring''Maxsus masofa
blockbooleanfalseFarzandlarni toʻliq kenglikda
equalbooleanfalseFarzandlarni teng kenglikda
requiredbooleanfalsearia-required
namestring''Input nomi

Events ​

ComponentEventDescription
VxRadioGroupupdate:modelValueTanlov oʻzgardi
VxRadioGroupchangeTanlov oʻzgardi

Slots ​

ComponentSlotDescription
VxRadiodefaultMaxsus label kontenti
VxRadiodescriptionMaxsus tavsif