Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

use_window_scroll

Reactive window scroll.

Demo

Usage

use leptos::prelude::*;
use leptos_use_window_scroll::use_window_scroll;

#[component]
fn Demo() -> impl IntoView {
let (x, y) = use_window_scroll();

view! { }
}

Server-Side Rendering

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

On the server this returns Signals that are always 0.0.

Installation

cargo add leptos-use-window-scroll

Source

Source • Demo • Docs