pub fn use_element_visibility<El, M>(target: El) -> Signal<bool>where
El: IntoElementMaybeSignal<Element, M>,
Expand description
Tracks the visibility of an element within the viewport.
§Demo
§Usage
let el = NodeRef::<Div>::new();
let is_visible = use_element_visibility(el);
view! {
<div node_ref=el>
<h1>{is_visible}</h1>
</div>
}
§Server-Side Rendering
On the server this returns a Signal
that always contains the value false
.