Crate swoop_ui

Source
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(),
    ));
}
  • HStack creates a horizontal layout with children aligned at the top.
  • The background color is set using the MENU_BAR_BACKGROUND value 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§

container
Layouts and containers
prelude

Structs§

SwoopUiPlugin
Reserved for future addition of system functions

Traits§

UiBase
Provides common builder-style methods for UI configuration
UiToBundle
Converts a custom UI builder into a Bevy-compatible Bundle