Crate allui

Crate allui 

Source
Expand description

§Allui

A SwiftUI-inspired UI framework for Rust, built on GPUI and gpui-component.

Allui mirrors SwiftUI’s declarative API and layout semantics as closely as Rust idioms allow. The core principle is that layout behavior must match SwiftUI exactly - a developer familiar with SwiftUI should be able to predict how Allui components will size, align, and compose.

§Quick Start

use allui::prelude::*;

VStack::new()
    .spacing(12.0)
    .child(
        Text::new("Hello, Allui!")
            .font(Font::title())
    )
    .child(
        Button::new("Click me", || {
            println!("Clicked!");
        })
    )
    .padding(20.0)
    .background(Color::gray())

§Modifier System

Like SwiftUI, modifiers wrap views and order matters:

// Padding is inside the background
Text::new("Hello")
    .padding(10.0)
    .background(Color::red())

// Padding is outside the background
Text::new("Hello")
    .background(Color::red())
    .padding(10.0)

Re-exports§

pub use modifier::Modified;
pub use modifier::Modifier;
pub use modifier::Tappable;

Modules§

alignment
Alignment types for Allui layout.
components
UI Components for Allui.
layout
Layout primitives for Allui.
modifier
Core modifier system for Allui.
prelude
Convenient imports for Allui users.
style
Styling types for Allui.
types
Common type definitions shared across Allui.