Skip to main content
🎉 A11y Issue Detection Agent is now live! Detect accessibility issues like a WCAG expert with AI. Try now!
No Result Found
Get your setup working faster. Join our Discord for optimisation tips from elite testers. Join our DiscordJoin our Discord

Accessible input field labels

Screen reader users rely on an input field’s accessible name to understand what data to enter. TalkBack on Android and VoiceOver on iOS read this name aloud. When a label is missing, or when it is a generic value such as editText or field1, screen reader users can’t determine the field’s purpose. This rule checks that every input field has a meaningful, persistent label that accurately describes the expected input, and that apps don’t rely solely on placeholder text, which disappears when the user starts typing.

  • Rule Category : Input Purpose
  • WCAG 2.1 & 2.2 SC : 1.3.5 (AA), 2.4.6 (AA), 2.5.3 (A), 3.3.2 (A)
  • RAAM 1.1 : 9.1, 9.2, 9.3, 9.4
  • Rule Severity : Serious
  • Supported Platforms and Frameworks : Android, iOS, React Native, Flutter apps

Success criteria

The rule checks for the following potential violations:

  • An input field’s accessible name does not meaningfully describe its purpose.
  • An input field has no label, placeholder, or value of any kind.
  • An input field relies only on placeholder text, such as hint on Android, placeholder on iOS, or hintText on Flutter, which disappears once the user starts typing.
  • An input field label repeats the field’s current value.

AI-powered testing

The BrowserStack AI-powered Issue Detection Agent evaluates whether an input field’s label meaningfully and persistently describes its purpose by conducting a multi-layered semantic analysis:

AI-powered results are clearly marked in the report so you can review and apply suggestions as needed.

The Issue Detection Agent performs the following checks:

  • Detects placeholder-only labels:
    • Identifies fields where only a placeholder is present and no persistent label is set, regardless of how descriptive the placeholder text is.
  • Evaluates label meaningfulness in context:
    1. Reads the field’s surrounding context to assess whether an ambiguous label becomes meaningful in context.
    2. Identifies if there is a mismatch between the programmatic accessible name and the visible on-screen label, or between the label and the field’s declared input type. For example, a password field labeled Phone number.
    3. Recognizes a standard icon near a field, such as a search icon, that conveys the field’s purpose. A field whose purpose is clear from a well-known icon isn’t flagged, even without a text label.
    4. Evaluates labels in multiple languages.
  • Suggests persistent, descriptive labels:
    1. Generates a label that reflects the field’s purpose and input type.
    2. When the programmatic label and the visible label differ, the suggestion includes a note to align both.
    3. When only a placeholder exists, the agent suggests a persistent label, not a replacement placeholder.

For more information, see Issue Detection Agent.

How to fix

You can fix violations manually or by applying the AI-powered fix.

Manual fix

To fix a violation, give the input field a persistent, descriptive label that matches its purpose:

  • Replace a generic label such as editText or field1 with a label that describes the expected input, such as Email address or Phone number.
  • Replace the placeholder for a field with a persistent visible label that stays visible even after the user begins typing, and associate it programmatically with the input field.
  • If the visible label and the programmatic accessible name differ, update both so they are consistent with each other and with the field’s input type.
  • If the field’s current value is used as its accessible name, set a descriptive accessibilityLabel on iOS or contentDescription on Android that describes the field’s purpose instead.

Platform and framework specific fixes

The element that represents an input field, and the attribute that carries its accessible name, vary by platform and framework. Apply the fix for your platform or framework:

  • Associate a visible TextView label with the EditText using the labelFor attribute, so the label text becomes the field’s accessible name and stays visible while the user types.
  • If no paired TextView is used, set a descriptive contentDescription on the EditText. Do not use a generic value such as editText or a resource ID.
  • Use hint only for placeholder text, not as the label. It disappears once the user starts typing, so always pair it with labelFor or contentDescription.
  • Set a descriptive accessibilityLabel on the UITextField or UITextView that describes the field’s purpose. Do not echo the placeholder or the field’s current value.
  • Alternatively, pair the field with a visible UILabel and group them in an accessible container, so VoiceOver announces the label together with the field.
  • Use placeholder only for hint text, not as the label. It disappears once the user starts typing, so always provide an accessibilityLabel or a persistent UILabel.
  • Set a descriptive accessibilityLabel on the TextInput component to provide the accessible name announced by screen readers.
  • For a persistent visible label, pair the TextInput with a Text component and associate them using nativeID on the Text and accessibilityLabelledBy on the TextInput.
  • Use placeholder only for hint text, not as the label. It disappears once the user starts typing, so always provide an accessibilityLabel or an associated visible label.
  • Set the labelText property in InputDecoration on a TextField or TextFormField. Unlike hintText, labelText persists above the field after the user starts typing.
  • For a custom field that does not use InputDecoration, wrap it in a Semantics widget and set a descriptive label.
  • Use hintText only for placeholder text, not as the label. It disappears once the user starts typing, so always provide a persistent labelText.

AI-powered fix

You can also use the AI-powered suggestions to ensure that all input fields have meaningful, persistent labels that accurately reflect their purpose.

The AI engine only generates the suggestions. You must manually review and implement the suggestions in your codebase using the steps mentioned in the Manual fix section.

Example

The following example scan report shows accessible input field label violations on the Profile information screen of an iOS app:

A scan report flagging two Profile information fields with missing or non-descriptive labels, suggesting the labels Pronouns and Bio.

Violation

  • One field shows the entered text they/them but has no label, so a user relying on a screen reader can’t tell that the field collects pronouns.
  • The other field has no descriptive label either. Its only label repeats the entered text Loves trail runs, so a user relying on a screen reader can’t tell that the field is for a short bio.

Fix

  • Set a descriptive accessibilityLabel on each field that states its purpose, such as Pronouns and Bio.
  • Do not use the user’s entered value as the label.

References

WCAG

RAAM 1.1

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback

Is this page helping you?

Yes
No

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback!

Talk to an Expert
Download Copy Check Circle