Skip to content

Component FocusRing

MeowLynxSea edited this page Jun 18, 2026 · 5 revisions

FocusRing

A wrapper that paints a focus indicator around a child element when the supplied FocusHandle is focused. Use on custom interactive elements that aren't built on top of Button.

use yororen_ui::headless::focus_ring::focus_ring;

focus_ring("my-ring", &self.my_focus_handle, cx)
    .render(cx)
    .child(/* the wrapped element */)

Props

Method Purpose
has_custom_color(v) Caller overrode the focus color.

Factory takes (id, &FocusHandle, _cx). The handle is borrowed (cloned inside the props). .render(cx) returns Stateful<Div>. Add the wrapped content via .child(...).

See also: Button, Modal.

Clone this wiki locally