Airframe GitHub Storybook
Component

ba-input-textarea

The textarea component provides a form control for long-form text input

Airframe

Active
Figma

Web Components

Active
Storybook GitHub

React

Active
Storybook GitHub

React Native

Planned
Design Code Accessibility QA
A

Label

A short, descriptive text that identifies the purpose of the textarea field

B

Hint text (optional)

Additional guidance below the label to help users complete the field correctly

C

Textarea field

The multi-line text entry area where users type their response, which can grow in height when the auto-grow attribute is set

For use when the user is required to input large amounts of text.

If only a small amount of text is needed such as a name, use <ba-input-text>

When setting a maxlength attribute, consider that many languages require more characters to express the same meaning. Ensure that the maximum length accommodates translations. For a guideline on the expected character length for different languages, refer to the multilingual design guidelines.

  <ba-input-textarea
    label="Please enter your message below"
    hint-text="Help text for the field"
    value=""
    name="name"
    auto-grow
  >
    <p slot="error">Custom error message</p>
  </ba-input-textarea>
Property Attribute Description Type Default
autoGrow auto-grow If true, the element height will increase based on the value. boolean | undefined false
hintText hint-text Hint text to show above the input string | undefined undefined
inputWidth input-width The width of the input in characters string | undefined undefined
invalid invalid If true, the textarea's content is incorrect boolean | undefined false
label(required) label A label for the input string undefined
maxlength maxlength This attribute specifies the maximum number of characters that the user can enter. Shows a character count when set. string | undefined undefined
minlength minlength This attribute specifies the minimum number of characters that the user can enter. string | undefined undefined
name(required) name The name of the control, which is submitted with the form data. string undefined
required required If true, the user must fill in a value before submitting a form. boolean | undefined false
rows rows The number of visible text lines for the textarea. number | undefined 3
value value The value of the textarea. null | string | undefined ''
  • None
Slot Description Permitted elements
"error" Element will be rendered in the error slot <p>

ba-input-textarea can be slotted into:

Event Description Type
baBlur Emitted when the input loses focus. CustomEvent<void>
baFocus Emitted when the input has focus. CustomEvent<void>
baOnInput Emitted when a keyboard input occurred. CustomEvent<KeyboardEvent>
baSubmit Emitted when the user submits the form from within the component CustomEvent<void>
Method Description
isValid() => Promise<boolean> Triggers required validation and resolves with validity state.
reset() => Promise<void> Resets the textarea back to its initial value and validity.

A simple textarea input.

A simple textarea input
<ba-input-textarea label="Label text" name="textarea" required></ba-input-textarea>

It is sometimes useful to add hint text.

A textarea input that has hint text
<ba-input-textarea label="Label text" name="textarea" hint-text="Custom hint text" required></ba-input-textarea>

It is sometimes useful to add custom validation messages. For example you may wish to:

  • Add translations
  • Provide more detail and/or contextual advice
  • Add links to further information on the error

We do provide error messages with translations for:

  • required
  • minlength error
  • maxlength error
A textarea input that has custom error messages and hint text
<ba-input-textarea label="Label text" name="textarea" hint-text="Custom hint text" required>
  <p slot="error">
    We need to know this. <a href="#">Why we need to know</a>
  </p>
</ba-input-textarea>
Prop Description Type Default
autoGrow If true, the element height will increase based on the value. boolean | undefined false
hintText Hint text to show above the input string | undefined undefined
inputWidth The width of the input in characters string | undefined undefined
invalid If true, the textarea's content is incorrect boolean | undefined false
label (required) A label for the input string undefined
maxLength This attribute specifies the maximum number of characters that the user can enter. Shows a character count when set. string | undefined undefined
minLength This attribute specifies the minimum number of characters that the user can enter. string | undefined undefined
name (required) The name of the control, which is submitted with the form data. string undefined
required If true, the user must fill in a value before submitting a form. boolean | undefined false
rows The number of visible text lines for the textarea. number | undefined 3
value The value of the textarea. null | string | undefined ''
error Element will be rendered in the error slot <p>

None

BaInputTextarea can be slotted into:

Event handler Description
onBaBlur Called when the input loses focus
onBaFocus Called when the input has focus
onBaInput Called when a keyboard input occurred
onBaSubmit Called when the user submits the form from within the component
Method Description
isValid() => Promise<boolean> Triggers required validation and resolves with validity state
reset() => Promise<void> Resets the textarea back to its initial value and validity

A simple textarea input.

A simple textarea input
<BaInputTextarea label="Label text" name="textarea" required />

It is sometimes useful to add hint text.

A textarea input that has hint text
<BaInputTextarea label="Label text" name="textarea" hintText="Custom hint text" required />

It is sometimes useful to add custom validation messages. For example you may wish to:

  • Add translations
  • Provide more detail and/or contextual advice
  • Add links to further information on the error

We do provide error messages with translations for:

  • required
  • minLength error
  • maxLength error
A textarea input that has custom error messages and hint text
<BaInputTextarea
  label="Label text"
  name="textarea"
  hintText="Custom hint text"
  required
  error="We need to know this"
/>

React Native documentation coming soon.

The component allows users to type or paste text that exceeds the defined maxlength. This ensures users who have difficulty tracking character counts can still complete their input, review it in full, and make edits before submission

When a user focuses on the textarea, assistive technologies announce the maximum character limit if a maxlength attribute is present. This ensures users relying on screen readers understand input constraints before typing begins.

This behavior addresses a common screen reader quirk: live character counters (using aria-live) are not always announced when focus first enters the textarea. By providing the limit as part of an accessible description, announced on focus, we ensure all users receive the same contextual information.

Always use the label attribute to give a meaningful label to the field.

Further reading:

Disabled form elements are not supported in BAgel because they create accessibility challenges, such as preventing keyboard navigation, confusing screen reader users, and reducing visual clarity for those with impairments

Further reading:

Placeholders on inputs are not supported in BAgel because they create accessibility challenges, such as failing to provide persistent labels for screen readers, reducing color contrast for users with visual impairments, and causing confusion for those with cognitive difficulties.

If you would like to add a infomations to help the user fill the input, you can use the hint-text attribute.

Further reading:

State: Previous element in DOM has focus

⇥ Tab

Moves focus to the ba-input-textarea field

State: ba-input-textarea field has focus

⇥ Tab

Moves focus to the next focusable element

⇧ Shift + ⇥ Tab

Moves focus to the previous focusable element

⏎ Enter

Inserts a new line within the textarea

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

  • ba-input-textarea is only used when users need to enter more than one line of text
  • ba-input-text is used instead when only a small amount of text is required, such as a name
  • A concise and descriptive label has been provided
  • Hint text is used when the expected format or constraints may not be obvious to the user
  • Required fields are marked with the required attribute
  • minlength and maxlength are set where the input has known character constraints, with translations accounted for
  • auto-grow is considered where the amount of content is unpredictable, so users are not restricted to a fixed, scrollable box
  • A meaningful label is provided via the label attribute
  • Hint text is used in preference to placeholder text, which is not supported
  • Error messages are descriptive and explain how to resolve the validation failure
  • The disabled state is not used — ba-input-textarea does not support disabled inputs

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

  • The field is keyboard operable and receives a visible focus indicator
  • Colour contrast meets WCAG AA for text and border in all states (default, focus, error)
  • The component renders correctly in Windows High Contrast Mode
  • Animation and transitions respect the prefers-reduced-motion media query
  • The maxlength limit is announced on focus so screen reader users understand input constraints before typing begins
Designing Developing Components BAgel helper Web QA React Native QA britishairways.com Careers Cookie policy