SwiftOpenUI is a cross-platform SwiftUI framework that lets you write SwiftUI code once
and run it natively on macOS, Linux, Windows, and the Web. No Electron, no webview
wrappers — each platform renders through its own native toolkit: GTK4 on Linux,
Win32/Direct2D on Windows, and DOM/Canvas on the Web via WebAssembly.
If you've ever wished you could take your SwiftUI skills beyond Apple's ecosystem, this
is that project. The API surface is real SwiftUI — @State, @Binding, NavigationStack,
.animation(), ForEach, the whole pattern. On macOS, your code compiles against actual
SwiftUI to validate API compatibility. On other platforms, SwiftOpenUI provides the same
protocols, property wrappers, and view types backed by platform-native rendering.
The framework currently implements 43 views (Text, Button, TextField, Toggle, Slider,
List, Grid, TabView, NavigationSplitView, Canvas, and more), 36 modifiers, and full state
management (@State, @Binding, @ObservedObject, @StateObject, @EnvironmentObject,
@Observable). Linux and Windows are at ~95% feature parity. The Web backend is at ~95%
and runs entirely in the browser via Swift-to-Wasm compilation.
SwiftOpenUI is MIT-licensed and designed for contributors. Every implemented feature is
tracked in a parity matrix, and the repo includes 14 runnable examples with automated
screenshot comparison across all four platforms. Adding a new view means defining one
struct in core and one rendering extension per backend — the architecture is clean and
approachable.
If you're a Swift developer who's been waiting for SwiftUI to go cross-platform, give it
a try: git clone, swift run ColorMixer, and see it render on your machine.

