UI
← Home

Focus Ring

A button that reveals its focus indicator with `:focus-visible` rather than `:focus`. Tab to it and a ring appears; click it with the mouse and there is no ring. This is the right way to keep focus visible for keyboard users without the noise of a persistent ring after every click — and the reason authors should never just remove the outline.

  • Axe
  • Focus

Preview

Installation

npx shadcn@latest add https://ui.publictheta.com/r/focus-ring.json

Conformance

Verified against the @publictheta/ui-spec focus-ring specification on both the React and vanilla reference implementations, across Chromium, Firefox, and WebKit.

  • Axe No WCAG 2 A/AA axe-core violations
  • Focus A visible focus indicator appears on keyboard focus (WCAG 2.4.7)

See the full conformance matrix across all components.