leptos_use

Function use_window_size

Source
pub fn use_window_size() -> UseWindowSizeReturn
Expand description

Reactive window size.

§Demo

Link to Demo

§Usage

let UseWindowSizeReturn { width, height } = use_window_size();

§Server-Side Rendering

On the server the width and height are always initial_size which defaults to Size { width: INFINITY, height: INFINITY }.