#bevy #inspector #visual #editor #game

archived bevy-contrib-inspector

starts a webserver for visually editing bevy resources

7 releases (4 breaking)

0.5.1 Dec 21, 2020
0.5.0 Dec 21, 2020
0.4.0 Dec 20, 2020
0.3.1 Dec 12, 2020
0.1.0 Sep 5, 2020

#8 in #inspector

42 downloads per month

MIT license

609 lines


This crate provides the ability to annotate structs with a #[derive(Inspectable)], which opens a web interface (by default on port 5676) where you can visually edit the values of your struct live.

Your struct will then be available to you as a bevy resource.

Your image title


use bevy_contrib_inspector::Inspectable;

#[derive(Inspectable, Default)]
struct Data {
    should_render: bool,
    text: String,
    #[inspectable(min = 42.0, max = 100.0)]
    size: f32,

Add the InspectorPlugin to your App.

use bevy_contrib_inspector::InspectorPlugin;

fn main() {
        // ...

fn your_system(data: ChangedRes<Data>, mut query: Query<...>) { /* */ }

To automatically open the webbrowser when starting, run your program using BEVY_INSPECTOR_OPEN=1 cargo run.


When deriving the Inspectable trait, you can set options such like the port the server will run on like so:

#[derive(Inspectable, Default)]
#[inspectable(port = 1234)]
struct Data {
   #[inspectable(a = 1, b = 2, c = 3)]
   field: Type,

The attribute on the struct will accept fields of the type InspectableOptions, while the attributes on the fields accept those of their <Type as AsHtml>::Options.


native: Instead of opening the inspector window in a browser, start a webkit2gtk window.

On ubuntu, the feature requires sudo apt install libwebkit2gtk-4.0-dev


~506K SLoC