Examples
Checkbox 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 or GCP.
Checkbox 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 or GCP.This is where custom content goes.
Props
Checkbox
Name | Type | Default | Description |
---|---|---|---|
idrequired | string | Id of the checkbox. | |
aria-label | string | Aria-label of the checkbox. | |
body | React.ReactNode | Body text of the checkbox | |
checked | boolean | ||
className | string | '' | Additional classes added to the Checkbox. |
component | React.ElementType | 'div' | Sets the input wrapper component to render. Defaults to <div> |
description | React.ReactNode | Description text of the checkbox. | |
isChecked | boolean | null | false | Flag to show if the Checkbox is checked. If null, the checkbox will be indeterminate (partially checked). |
isDisabled | boolean | false | Flag to show if the Checkbox is disabled. |
isValid | boolean | true | Flag to show if the Checkbox selection is valid or invalid. |
label | React.ReactNode | Label text of the checkbox. | |
onChange | (checked: boolean, event: React.FormEvent<HTMLInputElement>) => void | () => {} | A callback for when the Checkbox selection changes. |
ouiaSafe | No type info | true |
CSS variables
.pf-c-check | --pf-c-check--GridGap | 0.25rem 0.5rem | ||
.pf-c-check | --pf-c-check__label--disabled--Color | #6a6e73 | ||
.pf-c-check | --pf-c-check__label--Color | #151515 | ||
.pf-c-check | --pf-c-check__label--FontWeight | 400 | ||
.pf-c-check | --pf-c-check__label--FontSize | 1rem | ||
.pf-c-check | --pf-c-check__label--LineHeight | 1.3 | ||
.pf-c-check | --pf-c-check__input--Height | 1rem | ||
.pf-c-check | --pf-c-check__input--MarginTop | calc(((1rem * 1.3) - 1rem) / 2) | ||
.pf-c-check | --pf-c-check__description--FontSize | 0.875rem | ||
.pf-c-check | --pf-c-check__description--Color | #6a6e73 | ||
.pf-c-check | --pf-c-check__body--MarginTop | 0.5rem | ||
.pf-c-check | --pf-c-check__label-required--MarginLeft | 0.25rem | ||
.pf-c-check | --pf-c-check__label-required--FontSize | 0.875rem | ||
.pf-c-check | --pf-c-check__label-required--Color | #c9190b | ||
.pf-c-check.pf-m-standalone | --pf-c-check--GridGap | 0 | ||
.pf-c-check.pf-m-standalone | --pf-c-check__input--Height | auto | ||
.pf-c-check.pf-m-standalone | --pf-c-check__input--MarginTop | 0 | ||
.pf-c-check__label:disabled | --pf-c-check__label--Color | #6a6e73 | ||
View source on GitHub