| Crates.io | bevy_ui_bits |
| lib.rs | bevy_ui_bits |
| version | 0.12.0 |
| created_at | 2023-02-21 20:45:36.201983+00 |
| updated_at | 2025-09-09 17:05:37.221529+00 |
| description | A tiny and opinionated collection of UI components for Bevy |
| homepage | https://github.com/septum/bevy_ui_bits |
| repository | https://github.com/septum/bevy_ui_bits |
| max_upload_size | |
| id | 791045 |
| size | 139,923 |
A tiny and opinionated collection of UI components for Bevy
use bevy::{color::palettes, prelude::*};
use bevy_ui_bits::*;
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_systems(Startup, spawn_ui)
.run();
}
fn spawn_ui(mut commands: Commands) {
commands.spawn(Camera2d::default());
let font = &Handle::default();
// Root is the base layout component for a given UI tree
let root = Root::new();
// Container is the typical layout component
let main_container = Container::height(Val::Px(500.0)).justify_between();
// Customize components fluently using a builder-lite pattern
let title = EmbossedText::large("My Game", font).color(palettes::css::GOLDENROD.into());
// UiButton provides a button with opinionated settings
let play = UiButton::rectangle().background_color(palettes::css::GOLDENROD.into());
let play_text = EmbossedText::medium("Play", font);
let by = SimpleText::small("By me", font);
// Use the new Spawn API to spawn the UI tree
commands.spawn((
root,
children![(
main_container,
children![title, (play, children![play_text]), by]
)],
));
}
Try it out with:
cargo run --example readme --features="bevy/default"

Try it out with:
cargo run --example showcase --features="bevy/default"

Try it out with:
cargo run --example main_menu --features="bevy/default"

Try it out with:
cargo run --example hud --features="bevy/default"
RootMarker
Try it out with:
cargo run --example despawn --features="bevy/default"
| bevy | bevy_ui_bits |
|---|---|
| 0.16 | 0.8 - 0.12 |
| 0.15 | 0.7 |
| 0.14 | 0.6 |
| 0.13 | 0.5 |
| 0.12 | 0.4 |
| 0.11 | 0.3 |
| 0.10 | 0.2 |
| 0.9 | 0.1 |
This project is dual-licensed under either:
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.