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

macro viewy-codegen

Procedural macros for Viewy web ui library

32 stable releases

1.12.3 Apr 30, 2024
1.10.2 Mar 11, 2024
1.8.14 Dec 6, 2023
1.8.13 Nov 21, 2023

#60 in #web-ui

Download history 4/week @ 2024-01-30 236/week @ 2024-02-13 18/week @ 2024-02-20 53/week @ 2024-02-27 113/week @ 2024-03-05 72/week @ 2024-03-12 4/week @ 2024-03-19 301/week @ 2024-04-02 92/week @ 2024-04-09 689/week @ 2024-04-16 53/week @ 2024-04-23 225/week @ 2024-04-30

391 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