WCAG 2.4.13: Focus Appearance
WCAG 2.4.13 Focus Appearance: Ensuring Clearly Visible Keyboard Focus Indicators
WCAG 2.4.13 Focus Appearance is a Level AA success criterion introduced in WCAG 2.1. It builds upon the foundational requirement of WCAG 2.4.7 Focus Visible by specifying concrete characteristics for the visibility of the keyboard focus indicator. While WCAG 2.4.7 simply requires any visual indication of focus, 2.4.13 mandates that this indication must be sufficiently prominent in terms of contrast and size, and must not be obscured.
This criterion ensures that users who rely on keyboard navigation, including those with low vision or cognitive disabilities, can easily perceive which interactive element currently has keyboard focus. Without a clear and discernible focus indicator, navigating a website or application solely with a keyboard becomes extremely challenging, if not impossible.
Understanding the Criterion’s Requirements
To satisfy WCAG 2.4.13, the visual focus indicator must meet the following specific conditions:
It’s important to note that if the focus indicator is provided by the user agent (browser) and meets these requirements, the author does not need to add custom styles. However, authors frequently override default browser styles, making them responsible for ensuring compliance.
Why Focus Appearance Matters
A clearly visible focus indicator is fundamental for an accessible user experience, particularly for:
When focus is difficult to discern, users may waste time trying to locate the active element, become disoriented, or abandon tasks altogether, leading to a frustrating and exclusionary experience.
Practical Guidelines for Compliance
To ensure your web components comply with WCAG 2.4.13, consider the following:
Examples of Correct Implementations
Using outline for a High-Contrast Focus Indicator
In this example, the outline property provides a clearly visible, sufficiently thick, and high-contrast focus indicator. Using outline-offset prevents the outline from being cut off or blending into the element’s border. The optional :focus:not(:focus-visible) snippet allows mouse users to click without seeing a default outline, enhancing aesthetics for them while preserving accessibility for keyboard users.
Using box-shadow for a Focus Indicator
Here, a box-shadow is used to create a glowing focus indicator. The 3px spread of the first shadow meets the size requirement, and its contrast against the button’s background would need to be checked. Crucially, the default outline is only removed because a robust and compliant alternative is in place.
Examples of Incorrect Implementations
Removing Focus Indicator Entirely
This code removes the default focus indicator without providing any visual replacement, making it impossible for keyboard users to know which element is currently focused. This fails both WCAG 2.4.7 and 2.4.13.
Insufficient Contrast or Size
While these examples provide some visual change, they are unlikely to meet the 3:1 contrast ratio or the minimum size requirements of WCAG 2.4.13. The focus indicator must be easily and unambiguously perceivable for all users.
Best Practices and Common Pitfalls
Best Practices:
Common Pitfalls:
By adhering to WCAG 2.4.13, you significantly enhance the usability of your website for a broad range of users, making it more robust, intuitive, and inclusive.
References
Related posts
- WCAG 5.2.3: Complete processes
- WCAG 5.2.4: Only Accessibility-Supported Ways of Using Technologies
- WCAG 5.2.5: Non-Interference
- WCAG 5.3.1: Required elements of the conformity declaration
- WCAG 5.3.2: Optional Components of a Conformance Claim
Still looking for answers?
Ask our experts using online chat