Radio

A radio is a button that's used to present users with mutually exclusive choices.

Examples

Basic

Checked

Label wrapping input

Reversed

Disabled

With description

Single-tenant cloud service hosted and managed by Red Hat that offers high-availability enterprise-grade clusters in a virtual private cloud on AWS od GCP.

With body

This is where custom content goes.

With description and body

Single-tenant cloud service hosted and managed by Red Hat that offers high-availability enterprise-grade clusters in a virtual private cloud on AWS od GCP. This is where custom content goes.

Standalone input

Documentation

Overview

The Radio component is provided for use cases outside of forms. If it is used without label text ensure some sort of label for assistive technologies. (for example: aria-label)

If you extend this component or modify the styles of this component, then make sure any hover styles defined are applied to the clickable elements, like <input> or <label> since hover styles are used to convey the clickable target area of an element. To maximize the target area, use the example html where the <label> is the wrapping element.

Accessibility

Attribute
Applied to
Outcome
disabled
<input type="radio">
Indicates that the element is unavailable and removes it from keyboard focus. Required when input is disabled
aria-describedby
.pf-v6-c-radio__input
When using .pf-v6-c-radio__description make use of this on the input.

Usage

Class
Applied to
Outcome
.pf-v6-c-radio
<div>, <label>
Initiates the radio component. Required
.pf-v6-c-radio__input
<input type="radio">
Initiates a radio input. Required
.pf-v6-c-radio__label
<label>, <span>
Initiates a label. Required
.pf-v6-c-radio__description
<span>
Initiates a radio description.
.pf-v6-c-radio__body
<span>
Initiates a radio body.
.pf-m-standalone
.pf-v6-c-radio
Modifies the radio component for use with a standalone <input type="radio">. Required when there is no label
.pf-m-disabled
.pf-v6-c-radio__label
Modifies the radio component for the disabled state. Required when input is disabled

CSS variables

Expand or collapse columnSelectorVariableValue
:where(:root, .pf-v6-c-radio)--pf-v6-c-radio--GridGap
0.5rem 0.5rem
:where(:root, .pf-v6-c-radio)--pf-v6-c-radio--AccentColor
(In light theme) #0066cc
:where(:root, .pf-v6-c-radio)--pf-v6-c-radio--Height
calc(0.875rem * 1.5)
:where(:root, .pf-v6-c-radio)--pf-v6-c-radio__label--disabled--Color
(In light theme) #a3a3a3
:where(:root, .pf-v6-c-radio)--pf-v6-c-radio__label--Color
(In light theme) #151515
:where(:root, .pf-v6-c-radio)--pf-v6-c-radio__label--FontWeight
400
:where(:root, .pf-v6-c-radio)--pf-v6-c-radio__label--FontSize
0.875rem
:where(:root, .pf-v6-c-radio)--pf-v6-c-radio__label--LineHeight
1.5
:where(:root, .pf-v6-c-radio)--pf-v6-c-radio__description--FontSize
0.75rem
:where(:root, .pf-v6-c-radio)--pf-v6-c-radio__description--Color
(In light theme) #4d4d4d
:where(:root, .pf-v6-c-radio)--pf-v6-c-radio__input--first-child--MarginInlineStart
0.0625rem
:where(:root, .pf-v6-c-radio)--pf-v6-c-radio__input--last-child--MarginInlineEnd
0.0625rem
:where(:root, .pf-v6-c-radio)--pf-v6-c-radio__body--MarginBlockStart
0.5rem
:where(:root, .pf-v6-c-radio)--pf-v6-c-radio__input--TranslateY
calc((1.5 * 0.875rem / 2 ) - 50%)
.pf-v6-c-radio__label:disabled--pf-v6-c-radio__label--Color
(In light theme) #a3a3a3