dioxus-std icon indicating copy to clipboard operation
dioxus-std copied to clipboard

A library to provide abstractions to access common utilities when developing Dioxus applications.

🧰 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

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

Geolocation example:

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

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

    match coords {
      Ok(coords) => {
        rsx!( p { "Latitude: {coords.latitude} | Longitude: {coords.longitude}" } )
      }
      Err(Error::NotInitialized) => {
        rsx!( p { "Initializing..." } )
      }
      Err(e) => {
        rsx!( 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.5", 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.