Function leptos_use::use_element_hover

source ·
pub fn use_element_hover<El, T>(el: El) -> Signal<bool>
where El: Clone + Into<ElementMaybeSignal<T, EventTarget>>, T: Into<EventTarget> + Clone + 'static,
Expand description

Reactive element’s hover state.

§Demo

Link to Demo

§Usage

let el = create_node_ref::<Button>();
let is_hovered = use_element_hover(el);

view! {
    <button node_ref=el>{ move || format!("{:?}", is_hovered.get()) }</button>
}

§Server-Side Rendering

On the server this returns a Signal that always contains the value false.