A focus ring is the visual cue that shows which element is currently selected while tabbing through a page. Because it looks unnecessary for mouse users, `outline: none` often gets applied — but that leaves keyboard and switch-device users with no way to tell where they are.
The `:focus-visible` pseudo-class lets the browser judge whether focus arrived via keyboard or pointer, and draws the ring only for keyboard focus. Mouse clicks stay visually clean while keyboard navigation keeps its indicator.
On the left (`outline: none`), tabbing through buttons leaves no visible trace of which one is selected. On the right (`:focus-visible`), the ring follows focus every step.
When to use
If you're tempted to strip outline on a custom button or card, replace it with :focus-visible instead — never remove it outright.