Skip to Content

Radio

Radio elements play a crucial role in UI/UX design by facilitating exclusive selection among a set of options. This ensures that users can choose only one item from a list, streamlining clear decision-making processes and providing enhanced control.

Examples

Basic Usage

Illustrates a singular Radio button allowing users to make a choice with a simple click:

Advanced Customization

Size Variations

Showcases Radio buttons in different sizes: small, medium, and large, accommodating various design needs and enhancing UI flexibility:

Disabled state

Demonstrates a Radio button in a disabled state, indicating non-interactive periods or conditions within the user interface:

Group of Radio Buttons with Single Form Control

A set of Radio buttons grouped together, allowing users to select one option from multiple choices, with a single selected value reflected in the application:

Theme Customization

The Radio component adheres to the following default theme, ensuring aesthetic consistency and visual appeal:

  • root{}(5 keys)
      Show all

Learn more about how to customize in the Theme documentation.

API

Tailor the Radio component’s functionality to meet your project’s requirements with a comprehensive set of properties:

Radio

NameTypeDefault
checkedboolean

Whether the radio is checked or not. Required only if Radio is used independently outside a RadioGroup. If Radio is used inside a RadioGroup then the value is internally set depending upon if the value is same as the selected value.

labelReactNode

Label for the radio.

disabledboolean

Whether the radio is disabled or not.

classNamestring

Additional class names to apply to the radio.

sizestring

Size of the radio.

'medium'
onChange(value: boolean) => void

Event handler for when the radio is changed.

onBlur(event: FocusEvent<HTMLDivElement, Element>) => void

Event handler for when the radio is blurred.

valueany

Value passed to the form when used inside a RadioGroup. Required when Radio is used within a RadioGroup

themeRadioTheme

Theme for the Radio.

RadioGroup

NameTypeDefault
childrenany

The Radio Buttons to display in the group.

classNamestring

Additional CSS classes to apply to the Radio group

onChange(value: any) => void

Event handler for when the radio selection is changed.

selectedValueany

Default value of the Radio Button which is checked

Design and Usability Tips

  • Label Legibility: Ensure that labels associated with radio buttons are clear, concise, and directly related to the options they represent. Labels should be positioned close to the respective radio button to maintain visual connection and prevent ambiguity during selection processes.
  • Distinctive Appearance: Design radio buttons to be visually distinctive from checkboxes to avoid confusion between multiple-choice and single-choice options. Employ standard design patterns, such as circular radio buttons with a filled circle indicator for the selected state, reinforcing their
Last updated on