#codegen #web-ui #web #generation #viewy

macro viewy-codegen

Procedural macros for Viewy web ui library

54 stable releases

Uses new Rust 2024

new 1.13.17 Apr 24, 2025
1.13.13 Jan 31, 2025
1.13.7 Dec 10, 2024
1.13.4 Nov 18, 2024
1.8.13 Nov 21, 2023

#29 in #web-ui

Download history 126/week @ 2025-01-15 578/week @ 2025-01-29 38/week @ 2025-02-05 17/week @ 2025-02-12 256/week @ 2025-04-16

256 downloads per month

MIT license

3KB

Viewy

A UI toolkit that combine the advantages of a design system and an ui library.

  • Customizable theme via config file
  • For small and more complex projects

"Hello, World!" example program (rocket.rs)

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])
}

No runtime deps