A container for form elements that has a built-in label, required/optional indicators, error messages, and layout options
Framework HTML React Angular
First option
Second option
Third option
error
Attribute errorType stringDefault ''Required falseDescription Returns formatted error messages related to the field
groupId
Attribute group-idType stringDefault undefinedRequired falseDescription Custom ID for the group element (used for aria-labelledby relationship)
hideLabel
Attribute hide-labelType booleanDefault falseRequired falseDescription Will visually hide the label
label
Attribute labelType stringDefault undefinedRequired falseDescription Label that represents the form control
layout
Attribute layoutType "horizontal" | "stacked"Default 'stacked'Required falseDescription Place label adjacent to input controls, or stack them vertically
showOptional
Attribute show-optionalType booleanDefault falseRequired falseDescription Indicator that a field is optional. If both showRequired and showOptional are true, showRequired will take precedence.
showRequired
Attribute show-requiredType booleanDefault falseRequired falseDescription Indicator that a field is required
variant
Attribute variantType "fieldset" | "group"Default 'group'Required falseDescription Render container as a fieldset or as a div
There are no events available for this component
Name Signature Description getLabelId() => Promise<string>Returns the label element’s ID for aria-labelledby association setFormControlId(id: string) => Promise<void>
Name Description Main content for help block helpAdditional descriptive text for the form-group label-slotSlot that supplements label attribute if rich content is required