Skip to content

Form group

A container for form elements that has a built-in label, required/optional indicators, error messages, and layout options

HTML React Angular
<certara-form-group label="Label">
<certara-input name="example"></certara-input>
</certara-form-group>
import { CertaraFormGroup, CertaraInput } from '@certara/certara-ui-react';
<CertaraFormGroup label="Label">
<CertaraInput name="example" />
</CertaraFormGroup>
// In your module (e.g., app.module.ts)
import { CertaraUiAngularModule } from '@certara/certara-ui-angular';
@NgModule({
imports: [CertaraUiAngularModule]
})
// In your template:
<certara-form-group label="Label">
<certara-input name="example"></certara-input>
</certara-form-group>
Use the fieldset variant to use the fieldset/legend semantic pattern. This is useful for patterns with a shared heading for multiple checkbox or radio controls.
First option Second option Third option
<certara-form-group label="Legend for group of options" variant="fieldset">
<certara-radio layout="stacked" name="radio-example">First option</certara-radio>
<certara-radio layout="stacked" name="radio-example">Second option</certara-radio>
<certara-radio layout="stacked" name="radio-example">Third option</certara-radio>
</certara-form-group>
import { CertaraFormGroup, CertaraRadio } from '@certara/certara-ui-react';
<CertaraFormGroup label="Legend for group of options" variant="fieldset">
<CertaraRadio layout="stacked" name="radio-example">First option</CertaraRadio>
<CertaraRadio layout="stacked" name="radio-example">Second option</CertaraRadio>
<CertaraRadio layout="stacked" name="radio-example">Third option</CertaraRadio>
</CertaraFormGroup>
// In your module (e.g., app.module.ts)
import { CertaraUiAngularModule } from '@certara/certara-ui-angular';
@NgModule({
imports: [CertaraUiAngularModule]
})
// In your template:
<certara-form-group label="Legend for group of options" variant="fieldset">
<certara-radio layout="stacked" name="radio-example">First option</certara-radio>
<certara-radio layout="stacked" name="radio-example">Second option</certara-radio>
<certara-radio layout="stacked" name="radio-example">Third option</certara-radio>
</certara-form-group>
<certara-form-group label="Horizontal" layout="horizontal">
<certara-input name="example"></certara-input>
</certara-form-group>
import { CertaraFormGroup, CertaraInput } from '@certara/certara-ui-react';
<CertaraFormGroup label="Horizontal" layout="horizontal">
<CertaraInput name="example" />
</CertaraFormGroup>
// In your module (e.g., app.module.ts)
import { CertaraUiAngularModule } from '@certara/certara-ui-angular';
@NgModule({
imports: [CertaraUiAngularModule]
})
// In your template:
<certara-form-group label="Horizontal" layout="horizontal">
<certara-input name="example"></certara-input>
</certara-form-group>

error

Attributeerror
Typestring
Default''
Requiredfalse
DescriptionReturns formatted error messages related to the field

groupId

Attributegroup-id
Typestring
Defaultundefined
Requiredfalse
DescriptionCustom ID for the group element (used for aria-labelledby relationship)

hideLabel

Attributehide-label
Typeboolean
Defaultfalse
Requiredfalse
DescriptionWill visually hide the label

label

Attributelabel
Typestring
Defaultundefined
Requiredfalse
DescriptionLabel that represents the form control

layout

Attributelayout
Type"horizontal" | "stacked"
Default'stacked'
Requiredfalse
DescriptionPlace label adjacent to input controls, or stack them vertically

showOptional

Attributeshow-optional
Typeboolean
Defaultfalse
Requiredfalse
DescriptionIndicator that a field is optional. If both showRequired and showOptional are true, showRequired will take precedence.

showRequired

Attributeshow-required
Typeboolean
Defaultfalse
Requiredfalse
DescriptionIndicator that a field is required

variant

Attributevariant
Type"fieldset" | "group"
Default'group'
Requiredfalse
DescriptionRender container as a fieldset or as a div

There are no events available for this component

NameSignatureDescription
getLabelId() => Promise<string>Returns the label element’s ID for aria-labelledby association
setFormControlId(id: string) => Promise<void>
NameDescription
Main content for help block
helpAdditional descriptive text for the form-group
label-slotSlot that supplements label attribute if rich content is required