Founding sponsorYour name here
Search…EnabledSave

The blue glow around the focused control is the focus ring

Focus Ring

/ NSView.focusRingType · NSWindow.makeFirstResponder(_:) /

also called keyboard focus indicator, focus halo, first responder ring

A focus ring is the accent-colored glow, commonly blue, around the control that currently receives keyboard interaction. Text fields normally accept focus, while Full Keyboard Access allows Tab to move focus through additional controls such as buttons and pop-up buttons. AppKit draws the ring for the first responder according to its focusRingType, and custom layouts must leave enough space for that ring to remain visible.

If you called it…

the blue glow around the selected controloutline that appears when you tab to a buttonblue border around the field that has keyboard focushighlight showing where keyboard input will goring around buttons when full keyboard access is on

…you meant a focus ring.

Anatomy — every part, named

  1. 1
    First responderNSWindow.firstResponder

    “The control that will get my typing” is the window's first responder.

Prompt — paste into your agent

Preserve the native Focus Ring around the first responder. In AppKit, make the control eligible for first-responder status, move focus with NSWindow.makeFirstResponder(_:), and keep NSView.focusRingType at .default; in SwiftUI, use View.focusable(_:) with FocusState. Leave enough space for the standard macOS accent-colored ring and do not replace it with a custom border.

Debug prompt — when it misbehaves

Paste this, then describe what you’re seeing — it hands your agent the classic failure modes to rule out first.

Debug my macOS focus ring (NSView.focusRingType, SwiftUI .focusable/.focusEffectDisabled). Rule out: Full Keyboard Access (AppleKeyboardUIMode) on the user's Mac making every first control grab focus and show a ring; focusRingType = .none silenced by a custom drawFocusRingMask; the ring clipped by an ancestor that clips to bounds; SwiftUI focus state fighting an explicit makeFirstResponder call. The symptom:

In code

The exact names this thing goes by in code — each row is one framework’s word for it. Use the row that matches your project (or paste it into your prompt).

AppKitNSView.focusRingType
AppKitNSWindow.makeFirstResponder(_:)
AppKitNSFocusRingType
SwiftUIView.focusable(_:)
SwiftUIFocusState

See also

Search

Describe the UI element you're thinking of