Shaft brings Flutter's elegant design to Swift's native performance. One codebase for desktop, mobile, and web.
Supports Major Platforms
macOS
Linux
Windows
Web
iOS
Android
import Shaft
import Observation
@Observable class Counter {
var count = 0
}
let counter = Counter()
class CounterView: StatelessWidget {
func build(context: BuildContext) -> Widget {
Column {
Text("Count: \(counter.count)")
Button {
counter.count += 1
} child: {
Text("Increment")
}
}
}
}
runApp(CounterView())
Combining proven concepts from Flutter with Swift's native performance
Just a regular Swift package - no build infrastructure or special toolchain required. Easy to customize and extend.
UI automatically syncs with data changes. No manual state management, no boilerplate - just mark data with @Observable and it works.
Native performance with ARC-based memory management. Built with Swift for optimal speed and efficiency.
Cross-platform hot reload solution enables real-time changes without restarting your application. See changes instantly.
True native threading with Swift's concurrency model. Built for demanding workloads with direct access to low-level graphics APIs.
Access platform APIs and rendering engines directly. No message channels or FFI bridging - just native Swift interop.
Experiment with Shaft directly in your browser using our interactive playground
Get up and running with Shaft in minutes
Install Xcode from the App Store
Install Swift and SDL dependencies:
sudo apt install ninja-build pkg-config libasound2-dev libpulse-dev libaudio-dev libjack-dev libsndio-dev libusb-1.0-0-dev libx11-dev libxext-dev libxrandr-dev libxcursor-dev libxfixes-dev libxi-dev libxss-dev libwayland-dev libxkbcommon-dev libdrm-dev libgbm-dev libgl1-mesa-dev libgles2-mesa-dev libegl1-mesa-dev libdbus-1-dev libibus-1.0-dev libudev-dev fcitx-libs-dev libunwind-dev libpipewire-0.3-dev libdecor-0-dev libfontconfig-dev
Install Swift stable release
# Clone the template
git clone https://github.com/ShaftUI/CounterTemplate.git
# Navigate to directory
cd CounterTemplate
# Run your app
swift run
Want to dive deeper?
Explore the full documentationSee your changes in real-time without restarting your app. SwiftReload works on macOS and Linux.
{
Text("Hello")
Text("World")
}
Change Row
to Column
- layout updates instantly
Changes appear in milliseconds without app restart
Works on macOS and Linux, Windows coming soon
Pure Swift solution, no Xcode or special toolchain required