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 impl Into value.
  • Contents are left-aligned using JustifyContent::Start.

The layout is finalized with .pack() and passed into commands.spawn to be spawn in the entity world.

Modules§

background
border
container
Layouts and containers
prelude
shadow

Structs§

SwoopUiPlugin
Reserved for future addition of system functions

Traits§

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