pub fn use_height(cx: &ScopeState) -> WindowHeight
Expand description

hooks for window’s height

Arguments

  • cx: [Scope] or [ScopeState]

returns: WindowHeight

Examples

use dioxus::prelude::*;
use dioxus_use_window::use_height;

fn App(cx: Scope) -> Element {
    let height = use_height(&cx);

    cx.render(rsx!(
        h1 { "Window height: {height}" }
    ))
}