#bevy-ui #gui #bevy #json #rust

famiq

Experimental GUI library, powered by Bevy engine

2 releases

Uses new Rust 2024

new 0.3.1 May 10, 2025
0.3.0 Apr 27, 2025
0.2.7 Mar 5, 2025
0.2.5 Feb 8, 2025
0.2.4 Jan 26, 2025

#732 in Game dev

Download history 91/week @ 2025-01-22 19/week @ 2025-01-29 144/week @ 2025-02-05 13/week @ 2025-02-12 14/week @ 2025-02-19 157/week @ 2025-02-26 163/week @ 2025-03-05 2/week @ 2025-03-12 2/week @ 2025-03-19 116/week @ 2025-04-23 27/week @ 2025-04-30

143 downloads per month

MIT license

375KB
9K SLoC

Static Badge Static Badge static Badge

Famiq

fn setup_ui( mut fa_query: FaQuery, mut famiq_res: ResMut<FamiqResource>) {
    fa_query.insert_num("count", 0);
    fa_query.insert_str("name", "");

    FamiqBuilder::new(&mut fa_query, &mut famiq_res).inject();

    container!(
        id: "#container",
        children: [
            text!(text: "$[name]", class: "my-2"),
            text_input!(placeholder: "Enter name", model: "name", class: "my-1"),
            button!(text: "Press me $[count]", id: "#btn")
        ]
    );
}

fn on_btn_press(mut events: EventReader<FaMouseEvent>, mut fa_query: FaQuery) {
    for e in events.read() {
        if e.is_button_pressed("#btn") {
            let count = fa_query.get_data_mut("count").unwrap().as_num_mut();
            *count += 1;
        }
    }
}

[!WARNING]

  • Famiq is new, many useful features are missing.
  • It's not there yet.... but feel free to try it and share your feedback!

Features

  • Built-in useful widgets including text input, modal, progress bar and more
  • Simple & lightweight, yet useful reactivity system
  • JSON based styling (similar to css), keep your rust code clean!
  • Yes it's fast!
  • use it for GUI apps or directly in your games

Demo

Installation

Get latest version of Famiq

cargo add famiq

or in Cargo.toml

famiq = "0.3.0"

Documentation

Contributing

Famiq needs your contributions. Please see contributing.

Versions

Currently, it supports only bevy 0.16.x onward.

License

Famiq is released under the MIT License.


lib.rs:

Experimental GUI library, powered by Bevy engine.

Example:

use bevy::prelude::*;
use famiq::prelude::*;

fn main() {
    App::new()
       .add_plugins(DefaultPlugins)
       .add_plugins(FamiqPlugin::new()) // add plugin
       .add_systems(Startup, setup_ui)
       .run();
}

fn setup_ui(
    mut fa_query: FaQuery, // required
    mut famiq_res: ResMut<FamiqResource>, // required
) {
    FamiqBuilder::new(&mut fa_query, &mut famiq_res).inject();

    let txt = text!(text: "Hello world");
    let btn = button!(text: "Press me");
    container!(children: [txt, btn]);

    // or

    container!(children: [
        text!(text: "Hello world"),
        button!(text: "Press me")
    ]);
}

Dependencies

~41–60MB
~1M SLoC