https://github.com/dioxus-community/dioxus-resize-observer
Resize observer hooks for Dioxus 🧬
https://github.com/dioxus-community/dioxus-resize-observer
dioxus
Last synced: about 1 year ago
JSON representation
Resize observer hooks for Dioxus 🧬
- Host: GitHub
- URL: https://github.com/dioxus-community/dioxus-resize-observer
- Owner: dioxus-community
- License: mit
- Created: 2023-10-01T21:14:29.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-12-15T09:40:46.000Z (over 1 year ago)
- Last Synced: 2025-06-10T08:29:42.060Z (about 1 year ago)
- Topics: dioxus
- Language: Rust
- Homepage:
- Size: 84 KB
- Stars: 10
- Watchers: 2
- Forks: 7
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# dioxus-resize-observer
[](https://github.com/dioxus-community/dioxus-resize-observer#license)
[](https://crates.io/crates/dioxus-resize-observer)
[](https://docs.rs/cdk-builder/latest/dioxus-resize-observer/)
[](https://github.com/dioxus-community/dioxus-resize-observer/actions)
[](https://discord.gg/sKJSVNSCDJ)
Resize observer hooks for [Dioxus 🧬](https://dioxuslabs.com/).
## Example
```rust
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