dfui 0.2.0

Declarative UI framework that draws shapes, text and icons analytically in one wgpu shader
Documentation
use dfui::taffy::AlignItems;
use dfui::widgets::{Styled, row, stateful, text, toggle};
use dfui::{Color, Element};

fn view() -> Element {
    stateful(|&on: &bool, h| {
        row([
            toggle(on)
                .accent(Color::hex(0x4cae6e))
                .on_change(move |cx, v| cx.update(h, move |s: &mut bool| *s = v))
                .into(),
            text(if on { "Wi-Fi on" } else { "Wi-Fi off" })
                .size(18.0)
                .into(),
        ])
        .gap(12.0)
        .align(AlignItems::CENTER)
    })
    .padding(16.0)
    .into()
}

fn main() {
    dfui::run(view);
}