Focus ring

Also called focus outline, focus indicator, or focus-visible

An outline that marks which element has keyboard focus, so people moving through a page with the Tab key can see where they are.

What is Focus ring?

When someone moves through a page with the Tab key, one element at a time has focus: the field they will type into, or the button that Enter will press. The focus ring is the visible marker around it, usually a 2px outline in the accent color with a small gap between the outline and the element.

Browsers draw a default ring, and many designs remove it with outline: none because it looks out of place. Without a replacement, keyboard users lose track of where they are, as the right-hand form in the demo shows. Restyle the ring to match your design and keep it.

Style :focus-visible instead of :focus. Browsers apply :focus-visible when focus should be shown, such as after a Tab press or inside a text field, and skip it when a mouse click focuses a button. Keyboard users get a clear ring, and mouse users don’t see one flash on every click.

Aim for at least 3:1 contrast between the ring and the colors around it, in both light and dark mode. Outlines take up no space, so an outline-based ring never shifts the layout, but a parent with overflow: hidden can clip it; outline-offset or a slightly inset ring helps.

All terms

Interaction states

The set of looks a control takes as people use it, such as default, hover, pressed, focused, and disabled, each showing what will happen.

Keyboard shortcut

A key combination that runs an action directly, like ⌘S to save or ⌘K to open search, so frequent users can skip the mouse.

Color contrast

How much text stands out from its background, measured as a ratio from 1:1 to 21:1 and checked against the WCAG levels AA and AAA.

Modal

A window that opens over the page, dims everything behind it, and blocks the rest of the interface until you finish or dismiss it.