GitHub
Core
Glass
Brutal
Humanist

Radio

Radio buttons are used for selecting a single option from a set of mutually exclusive choices.

Radio Container Playground

Radio Container Playground
Preview
Code
Basic Plan$0/month - For personal use
Pro Plan$29/month - For small teams
EnterpriseCustom - For large organizations
Controls
Size:
Small
Medium
Large
Supporting Text:
Disabled:

Radio Label Playground

Radio Label Playground
Preview
Code
All notificationsGet all updates and alerts
Mentions onlyOnly when you are tagged
No notificationsMute all sounds and alerts
Controls
Size:
Small
Medium
Large
Supporting Text:
Disabled:

Radio Playground

Radio Playground
Preview
Code
Controls
Size:
Small
Medium
Large
Disabled:

Installation

You can add the radio component to your project manually:

1

Install the following dependencies:

npm install @react-aria/focus @react-aria/interactions @react-aria/utils
2

Copy and paste the following code into your project.

Loading source code...
3

Update the import paths to match your project setup.

Update the import aliases (e.g. @/components, @/utils) in the copied files to match your project's path configuration.

Basic Usage

import { Radio } from '@versaui/ui/components/Radio';
// Basic radio
<Radio />
// Controlled radio
<Radio selected={isSelected} onChange={setIsSelected} />
// Different sizes
<Radio size="small" />
<Radio size="medium" />
<Radio size="large" />
// Disabled radio
<Radio disabled />
// Selected and disabled
<Radio selected disabled />

Accessibility

  • Uses native <input type="radio"> for full accessibility
  • Proper aria-checked and aria-disabled attributes
  • Group association via name prop
  • Keyboard navigation within radio groups

RadioContainer Props

PropTypeDefaultDescription
titlestring-Container title text.
supportingTextstring-Description text below title.
size'small' | 'medium' | 'large''medium'Radio button size.
selectedbooleanfalseControlled selected state.
disabledbooleanfalsePrevents interaction.
onChange(selected: boolean) => void-Called when selected state changes.

RadioLabel Props

PropTypeDefaultDescription
labelstring-Label text next to radio.
supportingTextstring-Helper text below the label.
size'small' | 'medium' | 'large''medium'Radio button size.
selectedbooleanfalseControlled selected state.
disabledbooleanfalsePrevents interaction.
onChange(selected: boolean) => void-Called when selected state changes.

Radio Props

PropTypeDefaultDescription
size'small' | 'medium' | 'large''medium'Radio button size.
selectedbooleanfalseControlled selected state.
disabledbooleanfalsePrevents interaction.
onChange(selected: boolean) => void-Called when selected state changes.
namestring-Group name for radio button association.
valuestring-Value for form submission.

On this page