Airframe GitHub Storybook
Component

ba-form-group

ba-form-group is used to show that a group of form elements are related

Airframe

Active
Figma

Web Components

Active
Storybook GitHub

React

Active
Storybook GitHub

React Native

Planned
Design Code Accessibility QA
A

Legend

Labels the group so users understand how the enclosed form elements are related

B

Hint text (optional)

Hint text to show under the legend

C

Form elements

The related form elements contained within the group

Grouping related fields together under headings and with defined boundaries helps users understand information on long forms.

Examples of when it could be used:

  • Passport information
  • Address details
  • Splitting by individual passenger(s) in a group

Further Reading:

<form>
  <ba-form-group legend="Form group legend">
    <ba-content>
      <p>HTML for form elements goes here</p>
    </ba-content>
  </ba-form-group>
</form>
Property Attribute Description Type Default
hintText hint-text Hint text to show under the legend string | undefined undefined
legend(required) legend Text to describe the form elements in the form group string undefined
  • None
Slot Description Permitted elements
Unnamed slot Elements will render in the body of the component <ba‑button>, <ba‑checkbox>, <ba‑checkbox‑card>, <ba‑checkbox‑list>, <ba‑content>, <ba‑details>, <ba‑flex>, <ba‑grid>, <ba‑input>, <ba‑input‑date>, <ba‑input‑datepicker>, <ba‑input‑email>, <ba‑input‑number>, <ba‑input‑password>, <ba‑input‑phone‑number>, <ba‑input‑secure‑field>, <ba‑input‑stepper>, <ba‑input‑text>, <ba‑input‑textarea>, <ba‑input‑typeahead>, <ba‑input‑upload>, <ba‑radio‑group>, <ba‑select>

ba-form-group can be slotted into:

ba-form-group must always be placed in a form and will always consist of a legend and a number of related form elements.

A basic example of ba-form-group nested in a form
<form>

  ...

  <ba-form-group legend="Legend Text">
    <!-- Form elements  -->
  </ba-form-group>

  ...

</form>
Prop Description Type Default
hintText Hint text to show under the legend string | undefined undefined
legend (required) Text to describe the form elements in the form group string undefined
children Elements will render in the body of the component <ba‑button>, <ba‑checkbox>, <ba‑checkbox‑card>, <ba‑checkbox‑list>, <ba‑content>, <ba‑details>, <ba‑flex>, <ba‑grid>, <ba‑input>, <ba‑input‑date>, <ba‑input‑datepicker>, <ba‑input‑email>, <ba‑input‑number>, <ba‑input‑password>, <ba‑input‑phone‑number>, <ba‑input‑secure‑field>, <ba‑input‑stepper>, <ba‑input‑text>, <ba‑input‑textarea>, <ba‑input‑typeahead>, <ba‑input‑upload>, <ba‑radio‑group>, <ba‑select>

None

BaFormGroup can be slotted into:

BaFormGroup must always be placed in a form and will always consist of a legend and a number of related form elements.

A basic example of BaFormGroup nested in a form
<form>

  ...

  <BaFormGroup legend="Legend Text">
    {/* Form elements */}
  </BaFormGroup>

  ...

</form>

React Native documentation coming soon.

The ba-form-group component is a stylised native fieldset. Find out more about it here:

The legend text helps users of assistive technologies understand that this component is a group of related form fields.

In high contrast mode:

  • The legend text uses the browser default text colour
  • A border is added after the legend text
  • A border is added around the whole component

No keyboard interactions have been defined for this component.

Use this checklist to confirm the component has been configured and used correctly.

  • ba-form-group is only used to group form elements that are related, e.g. passport information, address details, or fields for an individual passenger
  • Legend text is short and clearly describes the relationship between the grouped elements
  • ba-form-group has a legend that describes the group of form elements
  • Focus indicator has not been obscured on all sides of any of the enclosed form elements

These checks are handled by the component and do not need to be repeated each time it is used.

  • ba-form-group is operable using assistive technology
  • Colour contrast for all states in all BAgel themes
  • High contrast mode adjustments
Designing Developing Components BAgel helper QA process britishairways.com Careers Cookie policy