| Crates.io | viewy-codegen |
| lib.rs | viewy-codegen |
| version | 1.13.33 |
| created_at | 2023-08-11 08:39:06.27+00 |
| updated_at | 2025-07-10 14:37:21.586945+00 |
| description | Procedural macros for Viewy web ui library. |
| homepage | |
| repository | https://github.com/strowbeary/viewy-rs |
| max_upload_size | |
| id | 941683 |
| size | 2,555 |
A UI toolkit that combine the advantages of a design system and an ui library.
use viewy::*;
use viewy::components::*;
#[macro_use] extern crate rocket;
pub fn default_layout() -> Box<dyn Fn(Box<dyn Renderable>) -> Box<dyn Renderable>> {
Box::new(move |content| Box::new({
content
}))
}
#[get("/")]
fn index() -> RawHtml<String> {
RawHtml({
Page::new(
&format!("{} – Viewy", "Hello World"),
&default_layout(),
{
Text::new("Hello world", TextStyle::LargeTitle)
}
)
.compile(RenderMode::Complete)
})
}
#[launch]
fn rocket() -> _ {
rocket::build().mount("/", routes![index])
}