-
Notifications
You must be signed in to change notification settings - Fork 9
Component FocusRing
MeowLynxSea edited this page Jan 24, 2026
·
5 revisions
A focusable element that shows a focus-visible ring.
This is a wrapper container that makes an element focusable and applies a focus-visible border.
use yororen_ui::component::focus_ring;
let view = focus_ring().child("Focusable");- Making custom widgets keyboard-focusable
- Wrapping non-interactive content that should show focus
-
focus_ring(): constructor -
id(...): stable identity -
color(Hsla): focus ring color (default:theme.border.focus) -
radius(AbsoluteLength): corner radius
-
id: defaults to a static"focus-ring"id if you don't provide one - Ring color:
theme.border.focus
-
If you render many FocusRings without explicit ids, they will share the same id; prefer providing
id(...)in repeated UIs. -
Use
ClickableSurface.focusable(true)when you also want click/hover behavior.
use gpui::{px, rgb};
use yororen_ui::component::focus_ring;
let view = focus_ring()
.radius(px(10.).into())
.color(rgb(0x2F63FF))
.child("Focusable content");Yororen UI v0.3.0 · repository · Apache-2.0 · This wiki documents Yororen UI v0.3.0.
This wiki documents Yororen UI v0.3.0 — the headless-core, swappable-renderer build.