Expand description
Swoop UI is a modular, ergonomic layout toolkit built on top of Bevy UI.
It introduces expressive layout containers like HStack, VStack, HGrid, and VGrid,
supporting fluent syntax for padding, spacing, border, and background styling.
§UI Layout Overview
This crate defines a menu bar container using a horizontal stack layout:
use bevy::prelude::*;
use swoop_ui::prelude::*;
fn setup(mut commands: Commands) {
commands.spawn((
HStack::new(AlignItems::Start, Val::Auto)
.background_color(Srgba::WHITE.into())
.justify_content(JustifyContent::Start)
.pack(),
));
}HStackcreates a horizontal layout with children aligned at the top.- The background color is set using the
MENU_BAR_BACKGROUNDvalue for theme consistency. - Contents are left-aligned using
JustifyContent::Start.
The layout is finalized with .pack() and passed into commands.spawn to be registered in the entity world.
Modules§
Structs§
- Swoop
UiPlugin - Reserved for future addition of system functions
Traits§
- UiBase
- Provides common builder-style methods for UI configuration
- UiTo
Bundle - Converts a custom UI builder into a Bevy-compatible Bundle