Examples
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 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.
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-v5-c-radio__input | When using .pf-v5-c-radio__description make use of this on the input. |
Usage
Class | Applied to | Outcome |
---|---|---|
.pf-v5-c-radio | <div> , <label> | Initiates the radio component. Required |
.pf-v5-c-radio__input | <input type="radio"> | Initiates a radio input. Required |
.pf-v5-c-radio__label | <label> , <span> | Initiates a label. Required |
.pf-v5-c-radio__description | <span> | Initiates a radio description. |
.pf-v5-c-radio__body | <span> | Initiates a radio body. |
.pf-m-standalone | .pf-v5-c-radio | Modifies the radio component for use with a standalone <input type="radio"> . Required when there is no label |
.pf-m-disabled | .pf-v5-c-radio__label | Modifies the radio component for the disabled state. Required when input is disabled |
CSS variables
Expand or collapse column | Selector | Variable | Value | |
---|---|---|---|---|
.pf-v5-c-radio | --pf-v5-c-radio--GridGap | 0.25rem 0.5rem | ||
--pf-v5-c-radio--GridGap --pf-v5-global--spacer--xs --pf-v5-global--spacer--sm $pf-v5-global--spacer--xs $pf-v5-global--spacer--sm pf-size-prem(4px) pf-size-prem(8px) 0.25rem 0.5rem | ||||
.pf-v5-c-radio | --pf-v5-c-radio__label--disabled--Color | #6a6e73 | ||
--pf-v5-c-radio__label--disabled--Color --pf-v5-global--disabled-color--100 $pf-v5-global--disabled-color--100 $pf-v5-color-black-600 #6a6e73 | ||||
.pf-v5-c-radio | --pf-v5-c-radio__label--Color | #151515 | ||
--pf-v5-c-radio__label--Color --pf-v5-global--Color--100 $pf-v5-global--Color--100 $pf-v5-color-black-900 #151515 | ||||
.pf-v5-c-radio | --pf-v5-c-radio__label--FontWeight | 400 | ||
--pf-v5-c-radio__label--FontWeight --pf-v5-global--FontWeight--normal $pf-v5-global--FontWeight--normal 400 | ||||
.pf-v5-c-radio | --pf-v5-c-radio__label--FontSize | 1rem | ||
--pf-v5-c-radio__label--FontSize --pf-v5-global--FontSize--md $pf-v5-global--FontSize--md pf-font-prem(16px) 1rem | ||||
.pf-v5-c-radio | --pf-v5-c-radio__label--LineHeight | 1.5 | ||
--pf-v5-c-radio__label--LineHeight --pf-v5-global--LineHeight--md $pf-v5-global--LineHeight--md 1.5 | ||||
.pf-v5-c-radio | --pf-v5-c-radio__input--TranslateY | calc((1.5 * 1rem / 2 ) - 50%) | ||
--pf-v5-c-radio__input--TranslateY calc((--pf-v5-c-radio__label--LineHeight * --pf-v5-c-radio__label--FontSize / 2 ) - 50%) calc((--pf-v5-global--LineHeight--md * --pf-v5-global--FontSize--md / 2 ) - 50%) calc(($pf-v5-global--LineHeight--md * $pf-v5-global--FontSize--md / 2 ) - 50%) calc((1.5 * pf-font-prem(16px) / 2 ) - 50%) calc((1.5 * 1rem / 2 ) - 50%) | ||||
.pf-v5-c-radio | --pf-v5-c-radio__input--TranslateY--moz | calc((1.5 * 1rem / 2 ) - 50%) | ||
--pf-v5-c-radio__input--TranslateY--moz --pf-v5-c-radio__input--TranslateY calc((--pf-v5-c-radio__label--LineHeight * --pf-v5-c-radio__label--FontSize / 2 ) - 50%) calc((--pf-v5-global--LineHeight--md * --pf-v5-global--FontSize--md / 2 ) - 50%) calc(($pf-v5-global--LineHeight--md * $pf-v5-global--FontSize--md / 2 ) - 50%) calc((1.5 * pf-font-prem(16px) / 2 ) - 50%) calc((1.5 * 1rem / 2 ) - 50%) | ||||
.pf-v5-c-radio | --pf-v5-c-radio__input--first-child--MarginLeft | 0.0625rem | ||
.pf-v5-c-radio | --pf-v5-c-radio__input--last-child--MarginRight | 0.0625rem | ||
.pf-v5-c-radio | --pf-v5-c-radio__description--FontSize | 0.875rem | ||
--pf-v5-c-radio__description--FontSize --pf-v5-global--FontSize--sm $pf-v5-global--FontSize--sm pf-font-prem(14px) 0.875rem | ||||
.pf-v5-c-radio | --pf-v5-c-radio__description--Color | #6a6e73 | ||
--pf-v5-c-radio__description--Color --pf-v5-global--Color--200 $pf-v5-global--Color--200 $pf-v5-color-black-600 #6a6e73 | ||||
.pf-v5-c-radio | --pf-v5-c-radio__body--MarginTop | 0.5rem | ||
--pf-v5-c-radio__body--MarginTop --pf-v5-global--spacer--sm $pf-v5-global--spacer--sm pf-size-prem(8px) 0.5rem | ||||
.pf-v5-c-radio.pf-m-standalone | --pf-v5-c-radio--GridGap | 0 | ||
.pf-v5-c-radio.pf-m-standalone | --pf-v5-c-radio__input--TranslateY | none | ||
.pf-v5-c-radio__label:disabled | --pf-v5-c-radio__label--Color | #6a6e73 | ||
--pf-v5-c-radio__label--Color --pf-v5-c-radio__label--disabled--Color --pf-v5-global--disabled-color--100 $pf-v5-global--disabled-color--100 $pf-v5-color-black-600 #6a6e73 |
View source on GitHub