Touch Target Spacing

Link to Touch Target Spacing copied to clipboard
important

WCAG 2.2 is currently in a draft state, therefore results for this rule will be automatically marked as "IGNORED". Results can still be viewed using the Issue Status dropdown in the dashboard. Once the success criteria has been finalized, the rule will be reinstated in a future release.

WCAG 2.2 - 2.5.8 AA Impact - Moderate

All active controls should have a minimum of 24pt by 24pt tappable area.

Impact

On a touch device, small controls are a usability issue for everyone. Additionally, people experiencing motor limitations have increased difficulty interacting with small targets.

tip

What's the difference?

You may have noticed this rule is very similar to our Touch Target Size rule! Touch Target Spacing aims for WCAG AA compliance, while Touch Target Size aligns with Apples recommendation of 44 by 44 points. We highly recommend supporting both rules as compliance with Apple's guidelines will ensure there are no issues when submitting to the App Store.

Confirmation

Run the application within Xcode and navigate to the screen containing the active control to test.

  1. Within Xcode, select Debug View Hierarchy
  2. Select the control to test
  3. Open the inspector panel if not visible
  4. Select the size inspector
  5. Observe the width and height of the selected control
  6. One of the following will happen:
  • Accessible: The view will be larger than the minimum requirement and not have overlapping views that cause the available target to be smaller than 24x24.
  • Accessible: The view will be smaller than the 24x24 minimum, but the padding around the view will make the button have enough space to be tapped reliably by users.
  • Accessible : Sliders maintain a space of 24pt along the length of the control.
  • Inaccessible : The view will be smaller than the 24x24 minimum and have insufficient padding between itself and nearby views.
  • Inaccessible : There is another interactable view that reduces the tappable area of the tested view below this minimum threshold.

How to Fix

An issue found by this rule occurs when the frame of an active control does not have a height and width of 24pt or more.

  • Setting the minimum height and width of the view to 24x24pt.
  • Adjust neighboring interactive views to allow for ample space between interactive components.
  • Remove obstructions around sliders.
  • Add a margin around interactive views.

UIKit

In storyboard:

  1. Navigate to the active control
  2. Open the inspector panel if not visible
  3. Select the size inspector
  4. Under View, update the width and height parameters to be a minimum of 24pt.

In code:

Update the width and height of the active control's frame to be a minimum of 24pt.

let button = UIButton(frame: CGRect(x: 10, y: 20, width: 24, height: 24))

SwiftUI

Use a frame modifier on the view to set the proper height and width.

Button("Next")
    .frame(minWidth: 24, minHeight: 24, alignment: .leading)