Focus Ring

Concept

The outline that shows which element is currently selected as someone moves through a screen with the keyboard.

Why it exists

Before this thing had a name, it was just "that blue outline the browser draws on its own." It never appeared in the mockup and always appeared on screen, so designers read it as a bug, and developers removed it with a single line of CSS. Removing it cost nothing, and that was the problem.

Pagedeck went through exactly this. In a design review Noa pointed at the blue outline on a button and asked for it to go, and Theo deleted it that afternoon. Both of them only ever used the product with a mouse, so for months nobody noticed anything wrong. The gap surfaced in an accessibility audit from a government customer. The reviewer, moving through the screen with nothing but the Tab key, wrote that he pressed Enter and a button he had never selected fired.

For someone who navigates by keyboard, this outline is the mouse cursor. Everyone agrees that hiding the cursor would make the mouse unusable, and yet the same deletion on the keyboard side went unquestioned for years. Naming it the focus ring was a way of calling it a required part rather than decoration.

How it works

The browser keeps focus on exactly one interactive element at a time and draws an outline around that element. Focus is simply the place keyboard input goes. Type and the characters land in the focused field; press Enter and the focused button fires.

A single interaction breaks into three steps.

  1. Pressing Tab moves focus to the next element in order. The order usually follows the order things appear in the markup, and Shift+Tab walks it backwards.
  2. The browser draws an outline around whatever just received focus. That outline is the focus ring.
  3. Enter or Space activates the element currently outlined. Drop step 2 and step 3 becomes a gamble.

The ring has to be visible, not merely present. The Web Content Accessibility Guidelines (WCAG), published by the international body that writes web standards, spell out the conditions in numbers: at least 2 pixels of thickness, and a brightness difference of at least 3 to 1 between the ring and whatever sits behind it. A blue ring on a white background clears that bar. The same blue ring on a blue button does not, because the two colors sit almost on top of each other. Thickness has a second job as well: a one-pixel hairline reads as part of the border on a rounded button, so the user sees a slightly heavier edge rather than a signal that they have arrived somewhere.

Teams often delete the ring because it lingers after a mouse click. The fix is to show it selectively. Browsers distinguish focus that arrived via the keyboard from focus caused by a click, so you can draw the ring only in the first case. Mouse users get a clean screen and keyboard users keep track of where they are.

Where it shows up

The phrase comes up most often in design system work. When the states of a button or input are defined, the focus state gets its own cell next to default, hover, pressed, and disabled. Decide it once and no screen has to decide it again; miss it once and every screen using that component misses it too. The cell itself is cheap — a color, a thickness, and an offset from the element — and it is the only place in the whole product where that decision needs to be made.

It also turns up around custom components. Semantic markup means using the tag that matches what an element actually is, and a real button tag brings focus and an outline along with it for free. A div styled to look like a button never receives Tab focus at all, so there is no opportunity to draw a ring. When someone reports a missing ring, check this before touching colors.

In overlays like modals, where the ring is tells the user where they are. Opening a modal moves focus inside it, Tab is trapped within it while it's open, and closing it returns focus to the button that opened it. Skip that last part and focus snaps back to the top of the page — someone reading the twentieth item in a list now has twenty Tab presses ahead of them.

Accessibility audits mention it constantly. Keyboard navigation is the work of making every function reachable without a mouse, and the focus ring is the marker that says where on that path you currently stand.

How it sounds at work

"The focus ring disappears on brand-color buttons. Let's add a white ring underneath it."

Two colors from the same family leave too little contrast, so rather than change the color, wrap a second outline that carries the contrast.

"This dropdown isn't reachable by Tab. That's a markup problem, not a focus ring problem."

Focus never lands on the element at all, so the fix lives in the tag rather than in the color.

"Hide the ring for mouse clicks only. Leave the keyboard case alone."

Where the "it looks messy" request and the accessibility requirement usually settle.

After the audit finding, the conversation at Pagedeck moved into the design system. Noa added a focus state to the button component and drew it as a double ring — a white inner line and a dark outer line — so it survives on light and dark backgrounds alike. Theo put those values into shared styles once and conditioned them on keyboard-driven focus.

A line went into the QA checklist too: on any new screen, take your hand off the mouse and get through the whole thing with Tab. Unlike a check such as color blindness support, which needs a tool, this one takes thirty seconds, so Sofia runs it on demo screens as well.

What people get wrong

The most common mistake is treating the focus ring as something that damages the design. An outline that wasn't in the mockup shows up on screen and reads as leftover noise, and when you test with a mouse it sticks around on the button you just clicked. But the moment it annoys and the moment it matters are different moments: one is right after a click, the other is mid-keyboard-navigation. Since the two can be handled separately, there is no reason to remove both. Remove both and a keyboard-only user has to press Enter without knowing whether they are standing on Pay or on Cancel. The screen still works in the sense that every button responds; it just stops telling anyone which button is about to respond.

The other belief is that the browser default is enough and no design work is needed. It does appear everywhere, which makes it easy to wave off. But the default color assumes a white background, so on a brand-colored button or a dark screen the contrast falls short and the ring effectively vanishes. A screen you assumed was covered comes back failed from an audit, and re-picking colors for every component lands all at once.

Where to go next

  • Accessibility

    see where the focus ring sits between the standards and the implementation work

  • Alt text

    the counterpart that carries information by sound rather than by sight

Last updated 2026-09-16