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

macro viewy-codegen

Procedural macros for Viewy web ui library

29 stable releases

new 1.12.0 Apr 19, 2024
1.10.2 Mar 11, 2024
1.8.14 Dec 6, 2023
1.8.13 Nov 21, 2023

#63 in #web-ui

Download history 7/week @ 2024-01-12 10/week @ 2024-01-19 13/week @ 2024-01-26 1/week @ 2024-02-02 73/week @ 2024-02-09 172/week @ 2024-02-16 39/week @ 2024-02-23 23/week @ 2024-03-01 167/week @ 2024-03-08 20/week @ 2024-03-15 2/week @ 2024-03-22 255/week @ 2024-03-29 45/week @ 2024-04-05

340 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