Focus State
UI DesignWhat is a Focus State
A focus state is the visual indicator that shows which element has keyboard focus. When users press Tab to move through a page, the focus state, often a focus ring, shows where they are and what Enter will activate.
How a Focus State works
- Outline or ring: Drawn around the focused element
- High contrast: Visible against every background
- Keyboard-first: The CSS :focus-visible selector shows it mainly for keyboard users
- Every element: Links, buttons, inputs and custom controls
Focus State and accessibility
WCAG 2.4.7 (level AA) requires a visible focus indicator. The stricter WCAG 2.4.13 (AAA) asks for an indicator at least as large as a 2 px outline with 3:1 contrast between focused and unfocused states. Never remove the browser outline without a replacement.
Why Focus States matter
Keyboard and screen reader users rely on focus to navigate. Without it, they are lost on the page.
Frequently asked questions
Is a visible focus state required?
Yes. WCAG 2.4.7 (level AA) requires a visible keyboard focus indicator for any interface that can be used with a keyboard. Removing the browser outline without a replacement fails this rule.
How visible should a focus indicator be?
WCAG 2.4.13 (level AAA) asks for an indicator at least as large as a 2 CSS pixel outline around the element, with at least 3:1 contrast between the focused and unfocused look.
What is the difference between :focus and :focus-visible?
:focus matches whenever an element has focus, including after a mouse click. :focus-visible matches only when the browser decides focus should be shown, mostly for keyboard users, so designers can show a ring for keyboard use without showing it on every click.
Related terms
View all UI Design terms →Keyboard Navigation
Keyboard navigation is using a website or app with the keyboard instead of a mouse . Users move between links, buttons and fields with the…
Interactive States
Interactive states are the visual changes that show how a component responds to the user. They tell users whether an element can be used…
Hover State
A hover state is the visual change that appears when a mouse pointer moves over an element , such as a button or link. It tells users that…
Accessibility
Accessibility in UX design refers to creating digital products that can be used by everyone , including people with visual, motor…
WCAG
WCAG, the Web Content Accessibility Guidelines , is the international standard for making web content accessible to people with…
Screen Reader
A screen reader is software that conveys what is on a screen in a non-visual way , usually as speech, but also as braille or sound. People…
