DioxusLabs / sdk

A library to provide abstractions to access common utilities when developing Dioxus applications.
Apache License 2.0
84 stars 13 forks source link

feat: `use_window_size` #34

Closed DogeDark closed 7 months ago

DogeDark commented 7 months ago

Adds a new hook and function for cross-platform window size retrieving.

fn App() -> Element {
    let window_size = use_window_size();

    rsx! {
        p { "Width: {window_size.0}" }
        p { "Height: {window_size.1}" }
    }
}