#dom #gui #dioxus #standard #hooks

dioxus-std

Platform agnostic library for supercharging your productivity with Dioxus

6 releases (3 breaking)

0.4.2 Jan 19, 2024
0.4.1 Nov 14, 2023
0.4.0 Aug 2, 2023
0.3.0 Aug 2, 2023
0.1.0 Apr 13, 2023

#124 in WebAssembly

Download history 53/week @ 2023-10-30 55/week @ 2023-11-06 116/week @ 2023-11-13 138/week @ 2023-11-20 122/week @ 2023-11-27 83/week @ 2023-12-04 92/week @ 2023-12-11 65/week @ 2023-12-18 85/week @ 2023-12-25 58/week @ 2024-01-01 85/week @ 2024-01-08 121/week @ 2024-01-15 147/week @ 2024-01-22 100/week @ 2024-01-29 62/week @ 2024-02-05 86/week @ 2024-02-12

400 downloads per month

MIT license

44KB
868 lines

🧰 Dioxus Standard Library 🚀

A platform agnostic library for supercharging your productivity with Dioxus.


This library is still under development. Expect breaking changes!


dioxus-std is a Dioxus standard library that provides abstractions for your Dioxus app. Abstractions included are notifications, clipboard, and more to come.

Features

  • Geolocation - (wasm, Windows)
  • Clipboard - (Desktop)
  • Notifications - (Desktop)
  • Color Scheme - (any)
  • Utility Hooks
    • use_rw - (any)
    • use_channel - (any)
    • use_interval (any)
  • i18n - (any)
  • Camera (Desktop)
  • WiFi (Desktop)
  • Bluetooth (Desktop)

Geolocation example:

use dioxus_std::geolocation::{
    init_geolocator, use_geolocation, PowerMode
};

fn app(cx: Scope) -> Element {
    let geolocator = init_geolocator(cx, PowerMode::High).unwrap();
    let coords = use_geolocation(cx);

    match coords {
      Ok(coords) => {
        render! { p { format!("Latitude: {} | Longitude: {}", coords.latitude, coords.longitude) } }
      }
      Err(Error::NotInitialized) => {
        render! { p { "Initializing..." }}
      }
      Err(e) => {
        render! { p { "An error occurred {e}" }}
      }
    }
}

Platform Support

Clipboard

On linux you need the x11 library to use the clipboard abstraction:

sudo apt-get install xorg-dev

Usage

You can add dioxus-std to your application by adding it to your dependencies.

[dependencies]
dioxus-std =  { version = "0.4.2", features = [] }

License

This project is licensed under the MIT license.

Every contribution intentionally submitted for inclusion in dioxus-std by you, shall be licensed as MIT, without any additional terms or conditions.

Dependencies

~1–51MB
~744K SLoC