Skip to content

Radio

Select a single option from a set.

Radio

value:option 1

Options

Basic Usage

Select a single option from a set.

vue
<template>
  <bp-space>
    <bp-radio v-model="val" :value="0">Option</bp-radio>
    <bp-radio v-model="val" disabled :value="1">Disabled option</bp-radio>
  </bp-space>
</template>

<script setup lang="ts">
import { ref } from "vue";
const val = ref(1);
</script>

Radio Group

Group options with radio-group.

vue
<template>
  <bp-space type="vertical">
    <bp-radio-group v-model="val">
      <template v-for="v in optionList">
        <bp-radio :value="v">{{ v }}</bp-radio>
      </template>
    </bp-radio-group>
    <bp-radio-group v-model="val1">
      <template v-for="v in optionList">
        <bp-radio :value="v">{{ v }}</bp-radio>
      </template>
    </bp-radio-group>
  </bp-space>
</template>

<script setup lang="ts">
import { ref } from "vue";

const val = ref('Male');
const val1 = ref('Female');
const optionList = ["Male", "Female", "Unknown"];
</script>

Button Radio Group

Use type="button" for a button-style group.

vue
<template>
  <bp-radio-group v-model="val" type="button">
    <template v-for="v in optionList">
      <bp-radio :value="v">{{ v }}</bp-radio>
    </template>
  </bp-radio-group>
</template>

<script setup lang="ts">
import { ref } from "vue";

const val = ref("Recommended");
const optionList = ["Recommended", "Latest", "Hottest"];
</script>

Radio Props

v-modelBound value
RadioValue
--
valueRadio value
RadioValue
--
disabledWhether disabled
Boolean
false-

RadioGroup Props

v-modelBound value
RadioValue
--
typeRadio group type
RadioType
--
disabledWhether disabled
Boolean
false-
sizeSize
ButtonSize
default-
directionRadio group type
DirectionType
--

Radio Events

changeTriggered when the radio value changesvalue:RadioValue-

Radio Slots

defaultContent--

RadioGroup Slots

defaultRadio list--