Skip to content

Radio

A set of checkable buttons—known as radio buttons—where no more than one of the buttons can be checked at a time. Based on BrConfigProvider for global theming.

Basic Usage

The most basic usage of radio buttons, usually used with BrRadioGroup.

Example

Disabled State

Set the disabled prop to disable the radio button.

Example

Sizes

We provide a default set of sizes. You can control the size of the radio button via the size prop. Supports xs, sm, md (default), lg, xl, 2xl.

Example

Horizontal Layout

Set the orientation="horizontal" prop to arrange the radio group horizontally.

Example

Theming

Global Customization (BrConfigProvider)

You can override default CSS variables via the theme prop of BrConfigProvider to customize colors, border radius, etc.

Custom Theme (Violet)

Example

Local Customization (TailwindCSS)

You can use TailwindCSS utility classes directly on the component to override styles.

vue
<template>
  <BrRadio class="border-red-500" label="Error State" />
</template>

API

BrRadio

Props

Prop NameTypeDefaultDescription
valuestring | number | boolean-Required. The value of the radio button
disabledbooleanfalseWhether the radio is disabled
labelstringundefinedLabel text
idstringundefinedInput ID
namestringundefinedInput name
requiredbooleanfalseWhether it is required
errorbooleanfalseWhether it is in error state
size'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | 'default''default'Size of the radio

Emits

Event NameDescriptionParameters
update:modelValueUpdate binding value(value: string | number | boolean)
changeChange event(value: string | number | boolean)

Slots

Slot NameDescription
defaultLabel content

BrRadioGroup

Props

Prop NameTypeDefaultDescription
modelValuestring | number | booleanundefinedBinding value
disabledbooleanfalseWhether to disable the entire group
orientation'horizontal' | 'vertical''vertical'Layout orientation
size'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | 'default''default'Size of all radios in the group
namestringundefinedName attribute for all radios
requiredbooleanfalseWhether it is required
loopbooleantrueWhether to loop keyboard navigation

Emits

Event NameDescriptionParameters
update:modelValueUpdate binding value(value: string | number | boolean)
changeChange event(value: string | number | boolean)