Form
A form is a group of elements used to collect information from a user. Related design guidelines: Forms
ExamplesPropsCSS VariablesProps
Name | Type | Required | Default | Description |
---|---|---|---|---|
children | React.ReactNode | No | null | Anything that can be rendered as ActionGroup content. |
className | string | No | '' | Additional classes added to the ActionGroup. |
Name | Type | Required | Default | Description |
---|---|---|---|---|
children | React.ReactNode | No | null | Anything that can be rendered as Form content. |
className | string | No | '' | Additional classes added to the Form. |
isHorizontal | boolean | No | false | Sets the Form to horizontal. |
Name | Type | Required | Default | Description |
---|---|---|---|---|
children | React.ReactNode | No | null | Anything that can be rendered as FormGroup content. |
className | string | No | '' | Additional classes added to the FormGroup. |
label | React.ReactNode | No | Label text before the field. | |
isRequired | boolean | No | false | Sets the FormGroup required. |
validated | 'success' | 'error' | 'default' | No | 'default' | Sets the FormGroup validated. If you set to success, text color of helper text will be modified to indicate valid state. If set to error, text color of helper text will be modified to indicate error state. |
isInline | boolean | No | false | Sets the FormGroup isInline. |
hasNoPaddingTop | boolean | No | false | Removes top spacer from label. |
helperText | React.ReactNode | No | Helper text after the field. It can be a simple text or an object. | |
helperTextInvalid | React.ReactNode | No | Helper text after the field when the field is invalid. It can be a simple text or an object. | |
fieldId | string | Yes | ID of the included field. It has to be the same for proper working. |
Name | Type | Required | Default | Description |
---|---|---|---|---|
children | React.ReactNode | No | null | Content rendered inside the Helper Text Item |
isError | boolean | No | false | Adds error styling to the Helper Text * |
isHidden | boolean | No | true | Hides the helper text * |
className | string | No | '' | Additional classes added to the Helper Text Item |
CSS Variables
.pf-c-form | --pf-c-form--GridGap | 1.5rem | ||
.pf-c-form | --pf-c-form__group--m-action--MarginTop | 2rem | ||
.pf-c-form | --pf-c-form--m-horizontal__group-label--md--GridColumnWidth | 9.375rem | ||
.pf-c-form | --pf-c-form--m-horizontal__group-label--md--GridColumnGap | 1rem | ||
.pf-c-form | --pf-c-form--m-horizontal__group-control--md--GridColumnWidth | 1fr | ||
.pf-c-form | --pf-c-form--m-horizontal__group-label--md--PaddingTop | 0.5rem | ||
.pf-c-form | --pf-c-form__group-label--PaddingBottom | 0.5rem | ||
.pf-c-form | --pf-c-form__label--FontSize | 0.875rem | ||
.pf-c-form | --pf-c-form__label--LineHeight | 1.3 | ||
.pf-c-form | --pf-c-form__label--m-disabled--Color | #6a6e73 | ||
.pf-c-form | --pf-c-form__label-text--FontWeight | 600 | ||
.pf-c-form | --pf-c-form__label-required--MarginLeft | 0.25rem | ||
.pf-c-form | --pf-c-form__label-required--FontSize | 0.875rem | ||
.pf-c-form | --pf-c-form__label-required--Color | #c9190b | ||
.pf-c-form | --pf-c-form__group-label-help--PaddingTop | 0.25rem | ||
.pf-c-form | --pf-c-form__group-label-help--PaddingRight | 0.25rem | ||
.pf-c-form | --pf-c-form__group-label-help--PaddingBottom | 0.25rem | ||
.pf-c-form | --pf-c-form__group-label-help--PaddingLeft | 0.25rem | ||
.pf-c-form | --pf-c-form__group-label-help--MarginTop | calc(0.25rem * -1) | ||
.pf-c-form | --pf-c-form__group-label-help--MarginRight | calc(0.25rem * -1) | ||
.pf-c-form | --pf-c-form__group-label-help--MarginBottom | calc(0.25rem * -1) | ||
.pf-c-form | --pf-c-form__group-label-help--MarginLeft | calc(0.25rem * -1 + 0.25rem) | ||
.pf-c-form | --pf-c-form__group-label-help--FontSize | 0.875rem | ||
.pf-c-form | --pf-c-form__group-label-help--TranslateY | 0.125rem | ||
.pf-c-form | --pf-c-form__group-control--m-inline--child--MarginRight | 1.5rem | ||
.pf-c-form | --pf-c-form__actions--child--MarginTop | 0.5rem | ||
.pf-c-form | --pf-c-form__actions--child--MarginRight | 0.5rem | ||
.pf-c-form | --pf-c-form__actions--child--MarginBottom | 0.5rem | ||
.pf-c-form | --pf-c-form__actions--child--MarginLeft | 0.5rem | ||
.pf-c-form | --pf-c-form__actions--MarginTop | calc(0.5rem * -1) | ||
.pf-c-form | --pf-c-form__actions--MarginRight | calc(0.5rem * -1) | ||
.pf-c-form | --pf-c-form__actions--MarginBottom | calc(0.5rem * -1) | ||
.pf-c-form | --pf-c-form__actions--MarginLeft | calc(0.5rem * -1) | ||
.pf-c-form | --pf-c-form__helper-text--MarginTop | 0.25rem | ||
.pf-c-form | --pf-c-form__helper-text--FontSize | 0.875rem | ||
.pf-c-form | --pf-c-form__helper-text--Color | #151515 | ||
.pf-c-form | --pf-c-form__helper-text-icon--FontSize | 1rem | ||
.pf-c-form | --pf-c-form__helper-text-icon--MarginRight | 0.25rem | ||
.pf-c-form | --pf-c-form__helper-text--m-error--Color | #c9190b | ||
.pf-c-form | --pf-c-form__helper-text--m-success--Color | #0f280d | ||
.pf-c-form.pf-m-horizontal | --pf-c-form__group-label--PaddingBottom | 0 | ||
.pf-c-form__helper-text.pf-m-error | --pf-c-form__helper-text--Color | #c9190b | ||
.pf-c-form__helper-text.pf-m-success | --pf-c-form__helper-text--Color | #0f280d | ||