Back to rankings

vladbat00/bevy_egui

Rust

This crate provides an Egui integration for the Bevy game engine. πŸ‡ΊπŸ‡¦ Please support the Ukrainian army: https://savelife.in.ua/en/

bevyeguibevy-engine
Star Growth
Stars
1.4k
Forks
338
Weekly Growth
β€”
Issues
40
5001k
Jan 2021Nov 2022Sep 2024Jul 2026
Artifactscrates.iocargo add bevy_egui
README

Stand With Ukraine

Hey! I'm the author of the crate, and I was born in Mariupol, Ukraine. When russians started the war in 2014, I moved to Kyiv. My parents, who had been staying in Mariupol till the start of the full-scale invasion, barely escaped the city alive. By the moment of writing (June 24th, 2026), we had 2225 air raid alerts in Kyiv, and russians managed to bomb the city 873 times.

If you are using this crate, please consider donating to any of the listed funds (see the banner above), that will mean a lot to me.

You can also support me directly via Patreon.

bevy_egui

Crates.io Documentation License Downloads CI

This crate provides an Egui integration for the Bevy game engine.

Trying out:

A basic WASM example is live at vladbat00.github.io/bevy_egui/ui.

Features:

  • Desktop and web platforms support
  • Clipboard
  • Opening URLs
  • Multiple windows support and split-screen support (see ./examples/two_windows.rs and ./examples/split_screen.rs)
  • Paint callback support (see ./examples/paint_callback.rs)
  • Mobile web virtual keyboard (still rough around the edges and only works without prevent_default_event_handling set to false in the WindowPlugin settings)
  • Accesskit support

bevy_egui

Dependencies

On Linux, this crate requires certain parts of XCB to be installed on your system. On Debian-based systems, these can be installed with the following command:

sudo apt install libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev

Usage

Here's a minimal usage example:

# Cargo.toml
[dependencies]
bevy = "0.19.0"
bevy_egui = "0.41.1"
use bevy::prelude::*;
use bevy_egui::{egui, EguiContexts, EguiPlugin, EguiPrimaryContextPass};

fn main() {
    App::new()
        .add_plugins(DefaultPlugins)
        .add_plugins(EguiPlugin::default())
        .add_systems(Startup, setup_camera_system)
        .add_systems(EguiPrimaryContextPass, ui_example_system)
        .run();
}

fn setup_camera_system(mut commands: Commands) {
    commands.spawn(Camera2d);
}

fn ui_example_system(mut contexts: EguiContexts) -> Result {
    egui::Window::new("Hello").show(contexts.ctx_mut()?, |ui| {
        ui.label("world");
    });
    Ok(())
}

Note that this example uses Egui in the multi-pass mode. If you don't want to be limited to the EguiContextPass schedule, you can use the single-pass mode, but it may get deprecated in the future.

For more advanced examples, see the examples section below.

Examples

To run an example, use the following command (you may replace ui with a name of another example):

cargo run --example ui

ui (live page, source: examples/ui.rs)

Showcasing some more advanced UI, rendering images, hidpi scaling.

absorb_input (live page, source: examples/absorb_input.rs)

Demonstrating the available options for absorbing input when Egui is using pointer or keyboard.

color_test (live page, source: examples/color_test.rs)

Rendering test from egui.rs. We don't fully pass it, help is wanted (#291).

side_panel (live page, source: examples/side_panel.rs)

Showing how to display an Egui side panel and transform a camera with a perspective projection to make rendering centered relative to the remaining screen area.

split_screen (live page, source: examples/split_screen.rs)

Demonstrating how to render multiple Egui contexts, attaching them to several cameras that target the same window.

render_egui_to_image (live page, source: examples/render_egui_to_image.rs)

Rendering UI to an image (texture) and then using it as a mesh material texture.

render_to_image_widget (live page, source: examples/render_to_image_widget.rs)

Rendering to a texture with Bevy and showing it as an Egui image widget.

two_windows (source: examples/two_windows.rs)

Setting up two windows with an Egui context for each.

paint_callback (live page, source: examples/paint_callback.rs)

Using Egui paint callbacks.

simple (live page, source: examples/simple.rs)

The minimal usage example from this readme.

run_manually (live page, source: examples/run_manually.rs)

The same minimal example demonstrating running Egui passes manually.

See also

Bevy support table

Note: if you're looking for a bevy_egui version that supports main branch of Bevy, check out open PRs, there's a great chance we've already started working on the future Bevy release support.

bevy bevy_egui
0.19 0.40-0.41
0.18 0.39
0.17 0.37-0.38
0.16 0.34-0.36
0.15 0.31-0.33
0.14 0.28-0.30
0.13 0.25-0.27
0.12 0.23-0.24
0.11 0.21-0.22
0.10 0.20
0.9 0.17-0.19
0.8 0.15-0.16
0.7 0.13-0.14
0.6 0.10-0.12
0.5 0.4-0.9
0.4 0.1-0.3
Related repositories
bevyengine/bevy

A refreshingly simple data-driven game engine built in Rust

Rustcrates.ioApache License 2.0bevygamedev
bevy.org
47.3k4.7k
valence-rs/valence

A Rust framework for building Minecraft servers.

Rustcrates.ioMIT Licensegamedevminecraft
valence.rs
3.3k165
rivet-gg/rivet

πŸ”© Serverless for stateful backends

Rustcrates.ioApache License 2.0game-developmentmultiplayer
rivet.gg
3.2k80
avianphysics/avian

ECS-driven 2D and 3D physics engine for the Bevy game engine.

Rustcrates.ioApache License 2.0bevyphysics
crates.io/crates/avian3d
3.1k265
bevy-cheatbook/bevy-cheatbook

Unofficial Reference Book for the Bevy Game Engine

Rustcrates.iobevydocumentation
bevy-cheatbook.github.io
2.4k136
Jondolf/avian

ECS-driven 2D and 3D physics engine for the Bevy game engine.

Rustcrates.ioApache License 2.0bevyphysics
crates.io/crates/avian3d
1.9k133
fishfolk/jumpy

Tactical 2D shooter in fishy pixels style. Made with Rust-lang πŸ¦€ and Bevy πŸͺΆ

Rustcrates.ioOthergamemodding
fishfolk.org/games/jumpy/
1.9k130
djeedai/bevy_hanabi

πŸŽ† Hanabi β€” a GPU particle system plugin for the Bevy game engine.

Rustcrates.ioApache License 2.0rustparticle
1.4k119
zkat/big-brain

Utility AI library for the Bevy game engine

Rustcrates.ioOtherbevy
1.3k81
NiklasEi/bevy_game_template

Template for a Bevy game including CI/CD for web, Windows, Linux, macOS, iOS and Android

Rustcrates.ioCreative Commons Zero v1.0 Universalbevygame-development
niklasei.github.io/bevy_game_template/
1.1k107
localgpt-app/localgpt

Local AI assistant, dreaming explorable worlds.

Rustcrates.ioApache License 2.0agentai
localgpt.app
1.1k101
cBournhonesque/lightyear

A networking library to make multiplayer games for the Bevy game engine

Rustcrates.ioApache License 2.0bevygamedev
cbournhonesque.github.io/lightyear/book
1.1k148