Skip to main content

Module focus_ring

Module focus_ring 

Source
Expand description

Focus ring wrapper with a true offset gap.

GPUI has no ring/ring-offset utility. To reproduce Tailwind’s ring-2 ring-offset-2 look (a ring separated from the element by a gap), we WRAP the focusable content in an outer bordered container with inner padding. The wrapper keeps its size in both states (transparent border when unfocused) so focus does not shift layout.

Functions§

focus_ring
Wraps content in a gapped focus ring of color, shown only when focused. Layout is stable across focus states.
focus_ring_error
Focus ring in the danger color, for invalid/error fields.
focus_ring_primary
Focus ring in the primary accent color (default for inputs/buttons).