dioxus-resize-observer

Crates.iodioxus-resize-observer
lib.rsdioxus-resize-observer
version0.3.0-alpha.4
sourcesrc
created_at2024-03-26 01:35:52.700056
updated_at2024-10-27 21:12:20.128373
descriptionResize observer hooks for Dioxus.
homepage
repositoryhttps://github.com/dioxus-community/dioxus-resize-observer
max_upload_size
id1185888
size58,448
Marc Espin (marc2332)

documentation

README

dioxus-resize-observer

License Crates.io Docs CI Discord Server

Resize observer hooks for Dioxus 🧬.

Example

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}"
    })
}

Support

  • Web renderer (WASM)
    • 0.1.0 - Dioxus v0.4
    • 0.2.0 - Dioxus v0.5
    • 0.3.0 - Dioxus v0.6

License

MIT

Commit count: 38

cargo fmt