#web-ui #ui #web #generation #code #viewy

macro viewy-codegen

Procedural macros for Viewy web ui library

44 stable releases

new 1.13.7 Dec 10, 2024
1.13.4 Nov 18, 2024
1.12.5-alpha.2 Jul 11, 2024
1.10.2 Mar 11, 2024
1.8.13 Nov 21, 2023

#85 in #web-ui

Download history 89/week @ 2024-08-25 107/week @ 2024-09-01 13/week @ 2024-09-08 302/week @ 2024-09-15 70/week @ 2024-09-22 97/week @ 2024-09-29 4/week @ 2024-10-06 127/week @ 2024-10-27 3/week @ 2024-11-03 190/week @ 2024-11-10 193/week @ 2024-11-17 8/week @ 2024-11-24 301/week @ 2024-12-01 215/week @ 2024-12-08

775 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