Examples
With description
With description and body
Documentation
Overview
The Check 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="checkbox"> | Indicates that the element is unavailable and removes it from keyboard focus. Required when input is disabled |
Usage
Class | Applied to | Outcome |
---|---|---|
.pf-c-check | <div> , <label> | Initiates the check component. Required |
.pf-c-check__input | <input type="checkbox"> | Initiates a check input. Required |
.pf-c-check__label | <label> , <span> | Initiates a label. Required |
.pf-c-check__description | <span> | Initiates a check description. |
.pf-c-check__body | <span> | Initiates a check body. |
.pf-m-standalone | .pf-c-check | Modifies the check component for use with a standalone <input type="checkbox"> . Required when there is no label |
.pf-m-disabled | .pf-c-check__label | Modifies the check component for the disabled state. Required when input is disabled |
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-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