pub fn use_document_visibility() -> Signal<VisibilityState>
Reactively track document.visibilityState
document.visibilityState
Link to Demo
let visibility = use_document_visibility();
On the server this returns a Signal that always contains the value web_sys::VisibilityState::Hidden.
Signal
web_sys::VisibilityState::Hidden