Accessibility

Focus state

A focus state is a visual indicator that highlights the user interface element currently selected or active through keyboard navigation or other input devices.

also called: focus indicator, focus ring

// definition

A focus state is a distinct visual style applied to an interactive element, such as a link, button, or form field, when it receives focus. As users navigate a digital interface using the Tab key or alternative input devices, the focus state moves sequentially from one interactive element to the next. This visual indicator typically appears as an outline, border, or background color change, providing clear real-time feedback regarding the location of user input.

Web standards, including the Web Content Accessibility Guidelines (WCAG), require focus states to remain visible and maintain minimum color contrast against adjacent backgrounds. Removing default browser focus indicators without providing a custom visual replacement makes websites unusable for individuals navigating without a mouse.

// why it matters

Maintaining visible focus states is critical for digital accessibility compliance and functional user experience. Without clear visual indicators, keyboard-only users cannot determine their location on a webpage, resulting in navigation errors, form drop-offs, and lost conversions. From a compliance perspective, suppressing focus indicators introduces significant legal risk under accessibility regulations like the Americans with Disabilities Act (ADA). Ensuring every interactive component displays an unambiguous focus state improves usability for power users, expands audience reach, and ensures alignment with mandatory accessibility criteria.

// example

An online registration form contains several text input fields, selection boxes, and a submission button. When a user navigates the form using the Tab key, a high-contrast outline immediately appears around the active text field. Tabbing further moves the outline step-by-step through each input until it surrounds the final submit button, signaling that pressing the Enter key will trigger form submission.

Questions and Answers

Can custom CSS styling replace default browser focus indicators?
Yes, custom Cascading Style Sheets (CSS) can replace default browser focus outlines, provided the replacement remains clearly visible and offers sufficient color contrast against adjacent elements. Web Content Accessibility Guidelines (WCAG) require custom focus indicators to have a minimum contrast ratio and area size to ensure they remain accessible to users with low vision or cognitive impairments.
Why do web designers sometimes disable focus outlines?
Designers sometimes remove focus outlines using specific Cascading Style Sheets (CSS) properties because default browser outlines can conflict with the intended visual design. However, completely removing focus states without supplying a custom visual alternative creates severe accessibility barriers. Modern web development practices recommend enhancing focus styles to complement the visual design rather than hiding them.
How do screen readers interact with focus states?
Screen readers rely on focus states to determine which element to read aloud as a user navigates through an application. When an interactive component receives focus, the screen reader announces its role, name, and current state to the user. A proper focus state ensures both visual and auditory feedback remain synchronized across all user interfaces.