# Accessible Name Starts With Label (Mobile)

> In mobile apps, the accessible name of an element with a visible label should start with that label, so assistive technologies match what users see.

Source: https://knowledge.evinced.com/mobile/mobile-validations/accessible-name-starts-with-label

For any element with a visible label, start the accessible name with that label, so assistive technologies match what users see.

Many elements have both a visible label and an accessible name, the programmatic name that assistive technologies use. Voice control users activate elements by speaking what they see on screen, and voice control software works best when the spoken words match the start of the accessible name. Make sure the accessible name contains the visible label and, whenever possible, begins with it. The simplest way is to not override the name at all, so it comes from the visible label.

**Note:** This validation covers names that contain the visible label but don't start with it. When the accessible name does not contain the visible label at all, see the related [label-in-name](https://knowledge.evinced.com/mobile/mobile-validations/label-in-name) validation.

## Pass Patterns

### Android

XML Views

The button has no `contentDescription`, so its accessible name is its visible text, "Order".

```xml
<Button
    android:layout_width="..."
    android:layout_height="..."
    android:layout_gravity="center"
    android:text="Order" />
```

### iOS

**UIKit**

The `accessibilityLabel` "Order items" starts with the visible title, "Order".

```swift
let orderButton = UIButton(type: .system)
orderButton.setTitle("Order", for: .normal)
orderButton.accessibilityLabel = "Order items"
```

**SwiftUI**

The button has no `accessibilityLabel`, so its accessible name is its visible title, "Order".

```swift
Button("Order") {
    placeOrder()
}
```

### Cross Platform

**Flutter (iOS)**

The `semanticsLabel` "Order items" starts with the visible text, "Order".

```dart
ElevatedButton(
  onPressed: placeOrder,
  child: const Text('Order', semanticsLabel: 'Order items'),
),
```

**React Native**

The `accessibilityLabel` "Order items" starts with the visible text, "Order".

```tsx
<Pressable
  accessibilityRole="button"
  accessibilityLabel="Order items"
  onPress={...}
>
  <Text>Order</Text>
</Pressable>
```

## Fail Patterns

### Android

XML Views

The `contentDescription` "Place order" contains the visible text, "Order", but doesn't start with it.

```xml
<Button
    android:layout_width="..."
    android:layout_height="..."
    android:text="Place order"
    android:contentDescription="Order" />
```

### iOS

**UIKit**

The `accessibilityLabel` "Place order" contains the visible title, "Order", but doesn't start with it.

```swift
let orderButton = UIButton(type: .system)
orderButton.setTitle("Order", for: .normal)
orderButton.accessibilityLabel = "Place order"
```

**SwiftUI**

The `accessibilityLabel` "Place order" contains the visible title, "Order", but doesn't start with it.

```swift
Button("Order") {
    placeOrder()
}
.accessibilityLabel("Place order")
```

### Cross Platform

**Flutter (iOS)**

The `semanticsLabel` "Place order" contains the visible text, "Order", but doesn't start with it.

```dart
ElevatedButton(
  onPressed: placeOrder,
  child: const Text('Order', semanticsLabel: 'Place order'),
),
```

**React Native**

The `accessibilityLabel` "Place order" contains the visible text, "Order", but doesn't start with it.

```tsx
<Pressable
  accessibilityRole="button"
  accessibilityLabel="Place order"
  onPress={...}
>
  <Text>Order</Text>
</Pressable>
```

## Try It Yourself

### Using voice input

**New to voice input testing, or need a refresher?**  
Review this article first: [Practical guides for using voice input](https://knowledge.evinced.com/a11y-essentials/practical-guides-for-using-voice-input)

1.  Turn on Voice Control on iOS, or Voice Access on Android. On Android, make sure Voice Access is listening, from the notifications panel.
2.  Say “*Show names*” on iOS, or “*Show labels*” on Android.
3.  Compare the name shown for each element with its visible label.

**Expected results:** The name shown for each element starts with the element's visible label.

**Actual results:** The name shown contains the visible label later in the text, for example “*Place order*” for a button labeled “*Order*”.

### 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 accessible name is empty, so the visible label is used, or it starts with the visible label.

**Actual results:** The accessible name starts with other words, and the visible label appears only later.

## FAQ

**Why is this issue marked as Best Practice?**

The visible label is still part of the accessible name, so voice control users can usually still activate the element. However, the mismatch at the start of the name can make voice commands less reliable, and users may need to try other commands, so it is rated best practice.

## 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

-   [Voice Input](https://knowledge.evinced.com/a11y-essentials/personas#voice-input)

## Learn More

-   [Understanding Success Criterion 2.5.3: Label in Name](https://www.w3.org/WAI/WCAG22/Understanding/label-in-name.html)

## Related Issues

-   [accessible-name](https://knowledge.evinced.com/mobile/mobile-validations/accessible-name)
-   [label-in-name](https://knowledge.evinced.com/mobile/mobile-validations/label-in-name)
