Skip to content
/ bumaga Public

A Rust library for building user interfaces using HTML and CSS

Notifications You must be signed in to change notification settings

lebedec/bumaga

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

.readme/header.png

A Rust-native library for building user interfaces using web development experience. You should use it if these features valuable to you:

  • HTML based UI definition and styling
  • CSS animations and transitions
  • Simple view bindings and interoperability based on JSON values
  • Graphics and windowing API agnostic
  • Fast prototyping first, hot reloading of view without compilation Rust app

The development of this library possible thanks to work of Rust enthusiasts: pest, taffy, other 🔥 🚀

TODO:

What it is not

  • Not an HTML/CSS/script engine or full spec implemenation (look sciter if you need)
  • Not a drawing solution, just abstract drawing instructions in result
  • Not a text rendering engine (actually you should provide one for correct work)

WARNING

Bumaga is still in the early stages of development. Important features are missing. Documentation is sparse.

Example

TODO: short description of architecture and real code example

fn main() {
    let mut engine = MyEngine::startup();
    let mut name = String::from("Alice");
    let component = Component::compile("partial.html", "component.css");
    loop {
        let value = json!({"name": name});
        let input = Input::from(engine.input)
            .fonts(engine.fonts)
            .value(value);
        let frame = component.update(input);
        if let Some(arg) = frame.calls.get("rename") {
            name = arg.to_string()
        }
        for element in frame.elements {
            engine.draw(element);
        }
    }
}
<body>
<div class="panel">
    <header>
        Bumaga Todo
        <span>Streamline Your Day, the Bumaga Way!</span>
    </header>
    <div *="todos" class="todo" onclick="remove(todos)">
        <span>{todos}</span>
        <div>×</div>
    </div>
    <input value="todo" oninput="edit" onchange="append"/>
</div>

.readme/example.avif

Using

Bumaga doesn't implement drawing. But here few examples with popular graphics solutions witch should help to understand how to implement it:

About

A Rust library for building user interfaces using HTML and CSS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published