Form.Group
Form.Group provides its children a context that contains ids and attributes
that enable these components to relate to each other according to WCAG guidelines.
Form.Group renders a FormGroupContextProvider which will autogenerate a
controlId if none is supplied and offers size, isInvalid, isValid in the
context. Form.Control, Form.Label, and Form.Control.Feedback consume this context.
Basic Usage
Any Paragon component or export may be added to the code example.
Any Paragon component or export may be added to the code example.
Sizes
Any Paragon component or export may be added to the code example.
Theme Variables#
| CSS Variable | Computed Value |
|---|---|
| | |
| | |
| | |
| | |
| | |
Props API#
- as
ElementTypeSpecifies base element for the component.
- children
ReactNodeRequiredSpecifies contents of the component.
- className
stringSpecifies class name to append to the base element.
- controlId
stringSpecifies id to use in the group, it will be used as
htmlForinFormLabeland asidin input components. Will be autogenerated if none is supplied. - isInvalid
booleanDefaultfalseSpecifies whether to display components in invalid state, this affects styling.
- isValid
booleanDefaultfalseSpecifies whether to display components in valid state, this affects styling.
- size
typeof FORM_CONTROL_SIZES.SMALL|typeof FORM_CONTROL_SIZES.LARGESpecifies size for the component. Either
'sm'or'lg'.
Usage Insights#
FormGroup
| Project Name | Paragon Version | Instance Count | |
|---|---|---|---|
| frontend-app-discussions | 23.14.9 | 1 |