Skip to Content
Patternfly Logo

Radio

Radio buttons are used to present the user with mutually exclusive choices. Radio buttons must always be presented in a group of two or more. Related design guidelines: Data input

ExamplesDocumentationCSS Variables

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.

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

AttributeApplied toOutcome
disabled<input type="radio">Indicates that the element is unavailable and removes it from keyboard focus. Required when input is disabled

Usage

ClassApplied toOutcome
.pf-c-radio<div>, <label>Initiates the radio component. Required
.pf-c-radio__input<input type="radio">Initiates a radio input. Required
.pf-c-radio__label<label>, <span>Initiates a label. Required
.pf-c-radio__description<div>Initiates a radio description.
.pf-m-disabled.pf-c-radio__labelInitiates a disabled style for labels. Required when input is disabled

CSS Variables

.pf-c-radio--pf-c-radio--GridGap
0.25rem 0.5rem
.pf-c-radio--pf-c-radio__label--disabled--Color
#6a6e73
.pf-c-radio--pf-c-radio__label--Color
#151515
.pf-c-radio--pf-c-radio__label--FontWeight
400
.pf-c-radio--pf-c-radio__label--FontSize
1rem
.pf-c-radio--pf-c-radio__label--LineHeight
1.3
.pf-c-radio--pf-c-radio__input--MarginTop
-0.1875rem
.pf-c-radio--pf-c-radio__input--first-child--MarginLeft
0.0625rem
.pf-c-radio--pf-c-radio__input--last-child--MarginRight
0.0625rem
.pf-c-radio--pf-c-radio__description--FontSize
0.875rem
.pf-c-radio--pf-c-radio__description--Color
#6a6e73
.pf-c-radio__label:disabled--pf-c-radio__label--Color
#6a6e73