Crates.io | viewy-codegen |
lib.rs | viewy-codegen |
version | 1.13.1 |
source | src |
created_at | 2023-08-11 08:39:06.27 |
updated_at | 2024-10-29 12:27:29.404154 |
description | Procedural macros for Viewy web ui library. |
homepage | |
repository | https://github.com/strowbeary/viewy-rs |
max_upload_size | |
id | 941683 |
size | 2,389 |
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])
}