RustUI - Cross-Platform UI Framework
A modern, cross-platform UI framework written in Rust that supports desktop, web, iOS, and Android platforms.
Quick Start
Installation
# Install the rust-native development tools
# Add rust-native to your project
Configuration
Create a rust-native.toml
in your project root:
= "my-app"
= ["Desktop"]
= "cargo run" # Optional: custom build command
Development Server
Start the development server:
# From your project directory
# Or specify a custom path
Server Controls
q
- Quit the server1
- Switch to Desktop mode (currently active)r
- Manual rebuild (coming soon)s
- Restart server (coming soon)
Status Indicators
The server displays build status with color coding:
- 🟢 Green: Ready/Success
- 🟡 Yellow: Building
- 🔴 Red: Error (with details)
Project Structure
your-project/
├── src/
│ └── main.rs # Your application code
├── rust-native.toml # Development configuration
└── Cargo.toml # Project dependencies
Features
- 🎯 Cross-platform support (Desktop, Web, iOS, Android)
- 🎨 Flexible styling system
- 📱 Responsive layouts
- 🔄 State management
- 🎭 Animations
- 📍 Gesture recognition
- 🧭 Navigation system
Getting Started
Prerequisites
# Install Rust
|
# Install additional dependencies for different platforms
# For iOS
# For Android
# For Web (WebAssembly)
Building and Running
Desktop
# Run desktop example
# Build for release
iOS
# Build for iOS simulator
# Build for iOS device
# Open Xcode project
Android
# Build Android libraries
# Open Android project in Android Studio
&&
Web
# Build WebAssembly package
# Serve example
&& &&
Examples
Basic App
use *;
Styled Components
.child
new
Responsive Layout
.with_responsive_layout
new
Project Structure
RustUI/
├── src/
│ ├── components/ # UI components
│ ├── platform/ # Platform-specific implementations
│ ├── animation/ # Animation system
│ ├── gesture/ # Gesture recognition
│ ├── layout/ # Layout system
│ ├── navigation/ # Navigation system
│ ├── renderer/ # Rendering backend
│ └── style/ # Styling system
├── examples/ # Example applications
├── ios/ # iOS project files
├── android/ # Android project files
└── www/ # Web (WebAssembly) files
Development Configuration Guide
rust-native.toml Configuration
The rust-native.toml
file is used to configure your RustUI development environment. Place this file in your project's root directory.
Basic Configuration
# Basic configuration
= "my-app"
= ["Desktop"]
= "cargo run"
Advanced Configuration
# Advanced configuration
= "my-complex-app"
= ["Desktop", "Web", "iOS", "Android"]
= "cargo run --example custom_app"
= ["src/", "examples/"]
= ["target/", "node_modules/"]
[]
= { = 800, = 600 }
= true
[]
= true
= "iphone"
[]
= "Pixel_4_API_30"
= 30
[]
= 8080
= "public"
Configuration Options
Option | Type | Default | Description |
---|---|---|---|
name |
String | Project directory name | Your application name |
target_platforms |
Array | ["Desktop"] |
Platforms to build for |
build_command |
String | "cargo run" |
Custom build command |
watch_paths |
Array | ["."] |
Directories to watch for changes |
exclude_paths |
Array | ["target"] |
Directories to ignore |
Platform-Specific Options
Desktop Configuration
[]
= { = 800, = 600 }
= true
= ["--release", "--features=desktop"]
iOS Configuration
[]
= true
= "iphone"
= "14.0"
Android Configuration
[]
= "Pixel_4_API_30"
= 30
= 21
Web Configuration
[]
= 8080
= "public"
= ["web-sys"]
Example Configurations
- Minimal Development Setup
= "my-app"
= ["Desktop"]
- Desktop Application with Hot Reload
= "my-desktop-app"
= ["Desktop"]
= "cargo run --example main"
[]
= true
= { = 1024, = 768 }
- Cross-Platform Mobile Development
= "my-mobile-app"
= ["iOS", "Android"]
= ["src/", "mobile/"]
[]
= true
= "universal"
[]
= "Pixel_4_API_30"
= 30
Usage Tips
-
Hot Reload Configuration
- Enable hot reload for faster development
- Specify watch paths for selective reloading
= ["src/components/", "src/styles/"] = ["src/tests/", "target/"]
-
Custom Build Commands
- Use environment variables
- Chain multiple commands
= "RUST_LOG=debug cargo run --example dev"
-
Platform-Specific Development
- Configure each platform separately
- Enable only needed platforms
= ["Desktop", "Web"] [] = true [] = 3000
For more information, visit our Configuration Documentation.
Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
Support
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- Rust community
- Cross-platform UI frameworks that inspired this project