stunt-router

Crates.iostunt-router
lib.rsstunt-router
version0.1.3
created_at2025-08-19 20:13:30.680695+00
updated_at2025-09-07 06:53:56.445252+00
descriptionPowerful router for stunt
homepage
repositoryhttps://github.com/proxin187/stunt
max_upload_size
id1802392
size10,743
Prox (proxin187)

documentation

README


stunt



crates.io docs.rs GitHub License


A frontend web framework for developing reactive user interfaces.

Features

  • Macro for writing html with rust expressions, similar to that of JSX.
  • Highly extensible components with compile-time type checked properties.
  • Use any build tool you like eg. trunk.
  • Multiple ways to manage the state of your application.

Goals

  • Optimized DOM api calls
  • Router implementation
  • Webworker integration
  • Support for desktop and mobile.

Usage

This crate is on crates.io and can be added either through adding stunt to your dependencies in Cargo.toml:

[dependencies]
stunt = "0.1.3"

Or running the following Cargo command in your project directory:

cargo add stunt

Example

More examples can be found at examples.

use stunt::prelude::*;

pub enum Message {
    Add,
}

pub struct App {
    count: usize,
}

impl Component for App {
    type Message = Message;
    type Properties = ();

    fn create() -> App {
        App {
            count: 0,
        }
    }

    fn callback(&mut self, message: &Message) {
        match message {
            Message::Add => {
                self.count += 1;
            },
        }
    }

    fn view(&self, _: ()) -> Html {
        html! {
            <div>
                <button onclick={ Message::Add } >
                    { "increment" }
                </button>
                <h1>
                    { self.count }
                </h1>
            </div>
        }
    }
}

fn main() {
    Renderer::new::<App>().render();
}

Contributing

We highly appreciate all contributions whether its a bug fix, feature, or documentation. If you encounter any bugs or otherwise weird behaviour we would really appreciate if you submitted an issue for us to look into.

License

stunt is licensed under the MIT license.

Commit count: 157

cargo fmt