Skip to main content

use_window_focus

Function use_window_focus 

Source
pub fn use_window_focus() -> Signal<bool>
Expand description

Reactively track window focus with window.onfocus and window.onblur events.

§Demo

Link to Demo

§Usage

let focused = use_window_focus();

§Server-Side Rendering

Make sure you follow the instructions in Server-Side Rendering.

On the server this returns a Signal that is always true.