bevy_extended_ui
Since I've been writing a game in the Bevy engine lately, I created this crate. In my game, I need more complex UI elements that Bevy doesn't currently support. These include sliders, choice boxes, check boxes, radio buttons, and so on. So I set about implementing these elements using the standard bevy_ui system. I'd like to make this project available to you so that you can use elements other than just nodes, buttons, or images. If you're missing a widget and know how to create it, it would be great if you could add it. Otherwise, feel free to create a ticket.
Features
There are many features in this crate. You can see all current supported widgets here. Available features:
- Full HTML support.
- CSS support but not all CSS properties.
- Hot reload support.
- HTML Bind support for interacting with the code.
- Font support for family and weight.
- Animation support (
@keyframes). - Breakpoint support (
@mediafor window size). - Validation for widgets like required fields.
- CSS
*support. - Custom Cursor or system cursor support.
- Form Widget for validation and submission.
- Customizable theme.
There are many other things, but currently you can use the core (HTML / CSS) features.
Toolchains
This project supports both stable and nightly Rust.
- Default:
stableviarust-toolchain.toml - Nightly:
cargo +nightly-2025-08-07 ...orrustup override set nightly-2025-08-07 - Optional: use
rust-toolchain-nightly.tomlas a drop-in replacement if you want nightly by default
How to use?
Add this to your Cargo.toml:
[]
= "1.4.2"
= "1.4.2"
Features
| Feature | Description |
|---|---|
default |
Enables css-breakpoints. |
wasm-default |
Web preset: wasm-breakpoints + clipboard-wasm with legacy WASM CSS/style pipeline compatibility. |
css-breakpoints |
Desktop breakpoints via primary window. |
wasm-breakpoints |
WASM breakpoints via browser viewport. |
fluent |
Enables Fluent Language support. |
properties-lang |
Enables Java Properties Language support. |
clipboard-wasm |
Enables WASM clipboard support web. |
Then, you add the plugin to your main.rs or on any point at a build function:
Then you create an HTML file:
Title
<!-- You can link your CSS file here. -->
<!-- <link rel="stylesheet" href="base2.css"> You can add more CSS files.-->
<!-- You can use HTML bindings here. like the onclick attribute. -->
Button
And finally,
Note that currently you can use this binding:
onclickonchangeOnly for<select>,<fieldset>,<input>,<date-picker>,<checkbox>,<slider>and<colorpicker>elements.actionon<form>for submit handlers with collected input dataoninitonmouseoveronmouseoutonfoucsonscrollonkeydownonkeyupondragstartondragondragstop
WASM support
Now we have wasm support but still not fully tested! Here is an example to show you how to use it:
and the index HTML:
<!doctype html>
Bevy Web
It was tested with the crate trunk, which worked well. This trunk.toml file was used:
[]
= "dist"
[[]]
= "assets"
= "assets"
[]
= true
Animation support
Basic @keyframes usage example:
{
0% }
50% }
100% }
}
}
Template data (reactive bindings)
There is no built-in loop/templating engine. Instead, the HTML parser collects {{...}} placeholders
into HtmlInnerContent, and you replace them in Rust based on your own model.
See:
examples/reactive_binding.rsexamples/template_iteration.rs
The iteration example renders a list by joining items into a single string (with \n line breaks)
and substituting {{inventory.list}} at runtime.
You can now use @keyframes in your CSS. There is now a limit tested; this means that you can use any CSS property.
Breakpoint support
Basic @media usage for breakpoints:
}
{
}
}
Breakpoint runtime source is feature-based:
css-breakpoints(default): tracks BevyPrimaryWindowsize.wasm-breakpoints: tracks browser viewport (window.innerWidth/innerHeight) for WASM and overridescss-breakpointswhen enabled.wasm-default: enableswasm-breakpointsandclipboard-wasmas a web preset.
What comes next?
Next, I'd like to build a website that's structured like React documentation. There you'll always be able to see all the patches and how to apply them! If anyone has any ideas, I'd be happy to hear them.
Compatibility
Note: This project is currently under construction and not suitable for large projects!.
Bevy version |
bevy_extended_ui version |
|---|---|
| 0.18.0 | 1.2.0 - 1.4.2 |
| 0.17.0 | 1.0.0 - 1.1.0 |
| 0.16.0 | 0.1.0 - 0.2.2 |
Note: WASM is not correctly supported in version 1.4.0 there is a layout bug. I'm working on this bug, but this needs time! Version 1.4.1 and above ar fixed for WASM.
Note: Version 0.1.0–0.3.0 are deprecated and will not be supported. If you’re interested in a version for bevy 0.16, then create an issue!
Important Links
Link to Widget attributes Link to Event Rules Link to Language Rules Link to CSS Properties Link to Patches