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.
- π 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)
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
- Rust 1.80+ (stable)
- Platform-specific requirements:
- Windows: MSVC or MinGW
- macOS: Xcode Command Line Tools
- Linux:
build-essential,libxkbcommon-dev
Add StratoSDK to your Cargo.toml:
[dependencies]
strato-core = "0.1.0"
strato-widgets = "0.1.0"
strato-platform = "0.1.0"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!"))),
])
)
}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));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![...])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);Comprehensive theming support:
let theme = Theme::dark();
ThemeProvider::new(theme)
.child(your_app_widget)# 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# 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- Core architecture
- Basic state management
- Event system
- Layout engine
- wgpu integration
- Basic shape rendering
- Text rendering
- Texture management
- Core widget system
- Basic widgets (Button, Text, Container)
- Layout widgets (Row, Column, Stack)
- Input widgets (TextInput)
- Desktop support (Windows, macOS, Linux)
- WebAssembly support
- Mobile support (future)
- Animation system
- Advanced widgets
- Visual designer
- Plugin system
| 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 |
- Startup Time: < 100ms
- Frame Time: < 16.67ms (60 FPS minimum)
- Memory Usage: < 50MB base
- WASM Size: < 500KB compressed
- Layout Time: < 1ms per 1000 widgets
We welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
StratoSDK is dual-licensed under either:
- AGPL v3 License (LICENSE-AGPLv3)
- Commercial license (LICENSE-COMMERCIAL)
at your option.
- 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
- Website: StratoSDK.dev
- GitHub: github.com/StratoSDK/strato-ui
- Discord: Join our community
- Twitter: @StratoHQ
Check out our examples directory for more complete applications:
- Hello World - Basic application structure
- Counter - State management example
-
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
-
Todo App - Full CRUD application (coming soon)
-
Calculator - Complex layout example
Built with β€οΈ in Rust by the StratoSDK Team
