/bevy-compose

Primary LanguageRustApache License 2.0Apache-2.0

bevy-compose

Crates.io version docs.rs docs CI status

Reactive UI framework for Bevy

fn ui(count: Res<Count>) -> impl Compose {
    (
        format!("High five count: {}", count.0),
        flex("Up high!").on_click(|mut count: ResMut<Count>| count.0 += 1),
        flex("Down low!").on_click(|mut count: ResMut<Count>| count.0 -= 1),
    )
}

Components are also supported with lazy(|player_query: Query<&mut Player>| { ... }

Inspiration

This crate is inspired by Xilem and SwiftUI with its typed approach to reactivity.