Crates.io | dioxus-resize-observer |
lib.rs | dioxus-resize-observer |
version | 0.3.0-alpha.4 |
source | src |
created_at | 2024-03-26 01:35:52.700056 |
updated_at | 2024-10-27 21:12:20.128373 |
description | Resize observer hooks for Dioxus. |
homepage | |
repository | https://github.com/dioxus-community/dioxus-resize-observer |
max_upload_size | |
id | 1185888 |
size | 58,448 |
Resize observer hooks for Dioxus 🧬.
use dioxus::prelude::*;
use dioxus_resize_observer::use_size;
use dioxus_use_mounted::use_mounted;
fn app() -> Element {
let mounted = use_mounted();
let (width, height) = use_size(mounted);
rsx!(div {
onmounted: move |event| mounted.onmounted(event),
"Size: {width} x {height}"
})
}
MIT