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

macro viewy-codegen

Procedural macros for Viewy web ui library

41 stable releases

new 1.13.4 Nov 18, 2024
1.13.1 Oct 29, 2024
1.12.5-alpha.2 Jul 11, 2024
1.10.2 Mar 11, 2024
1.8.13 Nov 21, 2023

#82 in #web-ui

Download history 281/week @ 2024-08-19 89/week @ 2024-08-26 111/week @ 2024-09-02 1/week @ 2024-09-09 324/week @ 2024-09-16 55/week @ 2024-09-23 94/week @ 2024-09-30 130/week @ 2024-10-28 206/week @ 2024-11-11

336 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