We'd like to set Google Analytics cookies to learn how people use the Knowledge Base, so we can improve it. We set them only if you accept.

Skip to main content
Digital Accessibility Knowledge Base

type-in-label

Mobile validation

Don't include the control or view type in an element's accessibilityLabel or contentDescription.

Assistive technologies already convey an element's type through its built-in semantics, such as its role or traits. Screen readers announce the type by default, for example “button” or “link”. When the accessible name also contains the type, such as “Submit button”, screen readers announce it twice, which adds noise and slows users down. Voice input users may also have to include the extra word in their commands. Remove the type from the accessible name, and let the element's role be announced on its own.

Note: When the type in the name contradicts the element's actual role, for example “Submit, link” on a button, see the related conflicting-type-in-label validation.

Pass Patterns

Android

The button's name comes from its text, with no type in it.

XML
<Button
    android:id="@+id/submitButton"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Submit" />

iOS

The button's name comes from its title, with no type in it.

Swift
let submitButton = UIButton(type: .system)
submitButton.setTitle("Submit", for: .normal)

Cross Platform

The button's name comes from its text, with no type in it.

Dart
ElevatedButton(
  onPressed: submit,
  child: const Text('Submit'),
),

Fail Patterns

Android

The contentDescription repeats the type, “Button”.

XML
<Button
    android:id="@+id/submitButton"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Submit"
    android:contentDescription="Submit, Button" />

iOS

The accessibilityLabel repeats the type, “Button”.

Swift
let submitButton = UIButton(type: .system)
submitButton.setTitle("Submit", for: .normal)
submitButton.accessibilityLabel = "Submit, Button"

Cross Platform

The Semantics label repeats the type, “Button”.

Dart
Semantics(
  label: 'Submit, Button',
  button: true,
  excludeSemantics: true,
  child: ElevatedButton(
    onPressed: submit,
    child: const Text('Submit'),
  ),
),

Try It Yourself

Using a screen reader

New to screen reader testing, or need a refresher?
Review this article first: Practical guides for using screen readers

  1. Turn on VoiceOver on iOS, or TalkBack on Android.
  2. Swipe right or left to move to the element.
  3. Listen to the element's name and its role.

Expected results: The screen reader announces the element's type once, for example “Submit, button”.

Actual results: The screen reader announces the type twice, once from the name and once from the element's role, for example “Submit, button, button”.

Tip: To hear the type more easily, set the screen reader to announce it first. On Android, open TalkBack settings > Advanced settings > Element description order and choose "Type, name, state". On iOS, open Settings > Accessibility > VoiceOver > Verbosity > Controls and choose "Speak Before".

Using developer tools

  1. iOS: In Xcode, open Xcode > Open Developer Tool > Accessibility Inspector, select the simulator or device, and point at the element. Check its Label.
  2. Android: In Android Studio, open the Layout Inspector and select the element. Check its contentDescription, for Views, or its semantics, for Jetpack Compose.

Expected results: The name contains no type, such as “button”, “link”, or “image”.

Actual results: The name contains the element's type.

FAQ

Why is this issue marked as Minor?

The element remains identifiable and operable. The repeated type only adds unnecessary words to the announcement, so the impact is limited, and it is rated minor.

Standards and Regulations

This issue is classified as "Best Practice," meaning it isn't tied to a specific WCAG success criterion or any other regulation or standard; however it still affects the experience of some users. These issues fall outside formal compliance requirements, yet addressing them improves usability and accessibility in practice.

Personas impacted by this issue

Learn More