Skip to content

StratoSDK is a framework with a declarative approach similar to Flutter/React, written and designed entirely for Rust.

License

Notifications You must be signed in to change notification settings

StratoHQ/StratoSDK

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

49 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

StratoSDK πŸ¦€

License: MIT/Apache-2.0 Rust Platform GitHub Sponsors

StratoSDK is a next-generation, lightweight, secure, and reactive UI framework written in pure Rust. It combines the declarative programming model of Flutter/React with Rust's performance and safety guarantees, offering GPU-accelerated rendering for desktop applications and WebAssembly support for web deployment.

Logo StratoSDK

Features

  • πŸš€ Pure Rust Implementation - Zero unsafe code, leveraging Rust's safety guarantees
  • 🎨 Declarative API - Intuitive widget-based UI construction similar to Flutter/React
  • ⚑ GPU Acceleration - Hardware-accelerated rendering via wgpu (Vulkan/Metal/DirectX/WebGL)
  • 🌐 Cross-Platform - Native support for Windows, macOS, Linux, and WebAssembly
  • πŸ”„ Reactive State Management - Built-in signals and reactive primitives
  • πŸ“¦ Lightweight - Minimal dependencies and small binary size
  • 🎭 Theming System - Comprehensive theming with dark/light mode support
  • πŸ”₯ Hot Reload - Fast development iteration (development mode)

Architecture

StratoSDK follows a modular architecture with clear separation of concerns:

strato-ui/
β”œβ”€β”€ strato-core/       # Core functionality (state, events, layout)
β”œβ”€β”€ strato-renderer/   # GPU rendering backend
β”œβ”€β”€ strato-widgets/    # UI component library
β”œβ”€β”€ strato-platform/   # Platform abstraction layer
└── strato-macros/     # Procedural macros for better DX

Quick Start

Prerequisites

  • Rust 1.80+ (stable)
  • Platform-specific requirements:
    • Windows: MSVC or MinGW
    • macOS: Xcode Command Line Tools
    • Linux: build-essential, libxkbcommon-dev

Installation

Add StratoSDK to your Cargo.toml:

[dependencies]
strato-core = "0.1.0"
strato-widgets = "0.1.0"
strato-platform = "0.1.0"

Hello World Example

use strato_widgets::prelude::*;
use strato_platform::ApplicationBuilder;

fn main() {
    ApplicationBuilder::new()
        .title("Hello StratoSDK")
        .run(build_ui())
}

fn build_ui() -> impl Widget {
    Container::new()
        .padding(20.0)
        .child(
            Column::new()
                .spacing(10.0)
                .children(vec![
                    Box::new(Text::new("Hello, StratoSDK!")),
                    Box::new(Button::new("Click Me")
                        .on_click(|| println!("Clicked!"))),
                ])
        )
}

πŸ“š Documentation

Core Concepts

Widgets

Widgets are the building blocks of StratoSDK applications. Every UI element is a widget with properties, state, and rendering logic.

// Creating widgets
let button = Button::new("Submit")
    .style(ButtonStyle::primary())
    .on_click(handle_submit);

let input = TextInput::new()
    .placeholder("Enter your name...")
    .on_change(|text| println!("Text: {}", text));

Layout System

StratoSDK uses a Flexbox-based layout system for arranging widgets:

Row::new()
    .spacing(10.0)
    .main_axis_alignment(MainAxisAlignment::SpaceBetween)
    .children(vec![...])

Column::new()
    .cross_axis_alignment(CrossAxisAlignment::Center)
    .children(vec![...])

State Management

Reactive state management with signals:

use strato_core::state::Signal;

let count = Signal::new(0);

// Subscribe to changes
count.subscribe(Box::new(|value| {
    println!("Count changed to: {}", value);
}));

// Update state
count.set(42);

Theming

Comprehensive theming support:

let theme = Theme::dark();
ThemeProvider::new(theme)
    .child(your_app_widget)

πŸ› οΈ Development

Building from Source

# Clone the repository
git clone https://github.com/StratoSDK/strato-ui.git
cd strato-ui

# Build all crates
cargo build --workspace

# Run tests
cargo test --workspace

# Run examples
cargo run --example hello_world
cargo run --example counter

WebAssembly Build

# Install wasm-pack
cargo install wasm-pack

# Build for web
wasm-pack build --target web crates/strato-platform

# Serve with a local server
python -m http.server 8000

Roadmap

Phase 1: Foundation βœ…

  • Core architecture
  • Basic state management
  • Event system
  • Layout engine

Phase 2: Rendering βœ…

  • wgpu integration
  • Basic shape rendering
  • Text rendering
  • Texture management

Phase 3: Widgets βœ…

  • Core widget system
  • Basic widgets (Button, Text, Container)
  • Layout widgets (Row, Column, Stack)
  • Input widgets (TextInput)

Phase 4: Platform

  • Desktop support (Windows, macOS, Linux)
  • WebAssembly support
  • Mobile support (future)

Phase 5: Polish

  • Animation system
  • Advanced widgets
  • Visual designer
  • Plugin system

Architecture Details

Multi-Crate Structure

Crate Description Key Features
strato-core Core functionality State management, events, layout engine
strato-renderer GPU rendering wgpu backend, texture atlas, text rendering
strato-widgets Widget library Declarative widgets, theming, builders
strato-platform Platform layer Window management, event loop, WASM support
strato-macros Procedural macros Derive macros, DSL support

Performance Targets

  • Startup Time: < 100ms
  • Frame Time: < 16.67ms (60 FPS minimum)
  • Memory Usage: < 50MB base
  • WASM Size: < 500KB compressed
  • Layout Time: < 1ms per 1000 widgets

🀝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development Setup

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

StratoSDK is dual-licensed under either:

at your option.

Acknowledgments

  • wgpu team for the excellent GPU abstraction
  • winit for cross-platform windowing
  • lyon for 2D graphics algorithms
  • cosmic-text for text rendering
  • The Rust community for amazing tooling and support

Contact - (not yet available)

Examples

Check out our examples directory for more complete applications:

Screenshot 2025-12-15 alle 22 55 19
  • Counter - State management example
Screenshot 2025-12-15 alle 22 48 41
  • Modern Dashboard - New! Comprehensive example featuring:

    • Modular architecture (Views, Components)
    • Multi-page navigation (Dashboard, Analytics, Users, Settings)
    • Modern UI with responsive layout (Flexbox)
    • Theming system
    • Simulated backend integration
    Screenshot 2025-12-15 alle 22 47 22
  • Todo App - Full CRUD application (coming soon)

  • Calculator - Complex layout example

Screenshot 2025-12-15 alle 22 46 42

Built with ❀️ in Rust by the StratoSDK Team

About

StratoSDK is a framework with a declarative approach similar to Flutter/React, written and designed entirely for Rust.

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published