Info
This post is auto-generated from RSS feed The Rust Programming Language Forum - Latest topics. Source: Stunt - A Modern Client-Side Web Framework
Hey there, for the last few months i've been working on stunt, a client-side web framework for Rust. Stunt is designed to be efficient, type checked, and small (only 2.3k loc at the time of writing).
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();
}
I'd highly appreciate any feedback or suggestions.
1 post - 1 participant
🏷️ Rust_feed