Crates.io | hirola-macros |
lib.rs | hirola-macros |
version | 0.4.0 |
source | src |
created_at | 2020-12-30 20:36:58.844357 |
updated_at | 2023-12-28 22:07:16.771133 |
description | Hirola is an un-opinionated web framework that is focused on simplicity and predictability |
homepage | |
repository | https://github.com/geofmureithi/hirola |
max_upload_size | |
id | 329391 |
size | 32,655 |
Hirola is a declarative frontend framework that is focused on simplicity and reactivity.
We are going to create a simple counter program.
cargo new counter
With a new project, we need to create an index file which is the entry point and required by trunk
cd counter
Create an index.html
in the root of counter. Add the contents below
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Hirola Counter</title>
</head>
<body></body>
</html>
Lets add some code to src/main.rs
use hirola::prelude::*;
use hirola::dom::*;
fn counter() -> Dom {
let count = Mutable::new(0i32);
let decrement = count.callback(|s| *s.lock_mut() -= 1);
let increment = count.callback(|s| *s.lock_mut() += 1);
html! {
<>
<button on:click=decrement>"-"</button>
<span>{count}</span>
<button on:click=increment>"+"</button>
</>
}
}
fn main() {
hirola::dom::mount(counter()).unwrap();
}
Now lets run our project
trunk serve
Check out Hirola Docs written with Hirola itself!
Here are some extensions for hirola:
Status | Goal | Labels |
---|---|---|
✔ | Basic templating with rust and rsx | ready |
✔ | Extend functionality with mixins | ready |
✔ | Components | ready |
✔ | SSR | ready |
✔ | Signals | ready |
🚧 | Form management | started |
⏳ | Markdown templating | pending |
🚧 | Styling | started |
⏳ | SSG | pending |