6 releases

0.3.0-alpha.4 Oct 27, 2024
0.3.0-alpha.3 Aug 28, 2024
0.2.1 Jun 6, 2024
0.2.0 Apr 4, 2024
0.2.0-alpha.1 Mar 26, 2024

#186 in WebAssembly

Download history 35/week @ 2024-07-24 66/week @ 2024-07-31 69/week @ 2024-08-07 26/week @ 2024-08-14 13/week @ 2024-08-21 136/week @ 2024-08-28 6/week @ 2024-09-04 19/week @ 2024-09-11 28/week @ 2024-09-18 35/week @ 2024-09-25 8/week @ 2024-10-02 6/week @ 2024-10-09 3/week @ 2024-10-16 93/week @ 2024-10-23 45/week @ 2024-10-30 14/week @ 2024-11-06

155 downloads per month
Used in 3 crates

MIT license

17KB
57 lines

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

Dependencies

~13–21MB
~304K SLoC