Skip to content
forked from DioxusLabs/sdk

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

License

Notifications You must be signed in to change notification settings

ealmloff/dioxus-std

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧰 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.0", 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.

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Rust 100.0%