#dioxus #standard #hook #dom #gui #color-scheme

dioxus-std

Platform agnostic library for supercharging your productivity with Dioxus

7 releases (4 breaking)

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

#190 in Multimedia

Download history 77/week @ 2024-01-17 86/week @ 2024-01-24 28/week @ 2024-01-31 2/week @ 2024-02-07 22/week @ 2024-02-14 68/week @ 2024-02-21 28/week @ 2024-02-28 15/week @ 2024-03-06 59/week @ 2024-03-13 17/week @ 2024-03-20 29/week @ 2024-03-27 185/week @ 2024-04-03 40/week @ 2024-04-10 4/week @ 2024-04-17 3/week @ 2024-04-24

51 downloads per month

MIT license

81KB
1.5K SLoC

[!NOTE] This crate is no longer updated as it has been moved from dioxus-std to dioxus-sdk as of April 4th, 2024.



🧰 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, geolocation and storage with more to come!

Features

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

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.

Dependencies

~2–45MB
~686K SLoC