Crates.io | dioxus-static-site-generation |
lib.rs | dioxus-static-site-generation |
version | 0.6.0-alpha.4 |
source | src |
created_at | 2024-08-01 03:33:16.028684 |
updated_at | 2024-11-01 23:32:59.805484 |
description | Static site generation for Dioxus |
homepage | https://dioxuslabs.com |
repository | https://github.com/DioxusLabs/dioxus/ |
max_upload_size | |
id | 1321562 |
size | 19,813 |
Website | Guides | API Docs | Chat
Fullstack utilities for the Dioxus
framework.
dioxus-hot-reload
.Full stack Dioxus in under 30 lines of code
#![allow(non_snake_case)]
use dioxus::prelude::*;
fn main() {
dioxus::launch(App);
}
#[component]
fn App() -> Element {
let meaning = use_signal(|| None);
rsx! {
h1 { "Meaning of life: {meaning:?}" }
button {
onclick: move |_| async move {
if let Ok(data) = get_meaning("life the universe and everything".into()).await {
meaning.set(data);
}
},
"Run a server function"
}
}
}
#[server]
async fn get_meaning(of: String) -> Result<Option<u32>, ServerFnError> {
Ok(of.contains("life").then(|| 42))
}
To get started with full stack Dioxus, check out our getting started guide, or the examples examples.
This project is licensed under the MIT license.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in Dioxus by you shall be licensed as MIT without any additional terms or conditions.