# SwiftUIWeb: Bringing SwiftUI to the browser with Embedded Swift and WebAssembly

**URL:** <https://forums.swift.org/t/swiftuiweb-bringing-swiftui-to-the-browser-with-embedded-swift-and-webassembly/90754>\
**Category:** Swift for WebAssembly\
**Tags:** linux, webassembly, wasm, swiftui, web\
**Created:** [November 14, 2026, 5:49pm UTC](https://forums.swift.org/t/swiftuiweb-bringing-swiftui-to-the-browser-with-embedded-swift-and-webassembly/90754 "2026-11-14T17:49:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vitorsilveira](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/vitorsilveira/32/36893_2.png) [@vitorsilveira](https://forums.swift.org/u/vitorsilveira)\
**Post date:** [November 14, 2026, 5:49pm UTC](https://forums.swift.org/t/swiftuiweb-bringing-swiftui-to-the-browser-with-embedded-swift-and-webassembly/90754/1 "2026-11-14T17:49:54Z")

</div>

Hi everyone!

I've been working on a project called **SwiftUIWeb** , and I've just made it open source.

The idea is pretty simple: what if we could take the SwiftUI code we already write for Apple platforms and run it directly in the browser?

SwiftUIWeb lets you build web applications using familiar SwiftUI APIs like `View`, `@State`, `@Observable`, `NavigationStack`, `List`, `Table`, and more.

Under the hood, it uses **Embedded Swift compiled to WebAssembly**. Swift runs inside a Web Worker, while a lightweight JavaScript layer applies updates to the browser's actual DOM, with CSS handling layout.

So instead of drawing everything onto a canvas, the browser still handles text selection, scrolling, input, accessibility, and other native web behaviors.

### Apple's Food Truck, running on the web

To test how far I could push the framework, I took Apple's Food Truck sample application and got it running on **iPhone, iPad, and the browser, sharing the same Swift sources**.

The video demonstrates all three platforms, including sidebar navigation, sortable tables, charts, maps, and animated layouts.

There were some necessary adaptations, mainly replacing Combine with Observation and providing browser alternatives for APIs like StoreKit and WeatherKit.

But whenever I encountered missing SwiftUI functionality, I tried to implement it in the framework rather than work around it in the application.

### Where things stand

The project is still a preview, and there are limitations.

- It requires the Swift 6.4 toolchain from [swift.org](http://swift.org) and the matching WebAssembly SDK.

- Some Apple frameworks, including SwiftData and App Intents, don't have browser equivalents.

- Embedded Swift introduces constraints around reflection, key paths, and certain language features.

- Initial download sizes are still larger than comparable JavaScript applications. Reducing WebAssembly output is one of my main priorities.

I've documented the architecture, limitations, benchmarks, and examples in the repository.

I'd really appreciate feedback from the Swift community, particularly around Embedded Swift, API compatibility, and anything that could be improved in the compilation approach.

The goal isn't to replace the browser's capabilities, but to make Swift and SwiftUI a practical way to build applications for it.

**GitHub:** [GitHub - Vitorsilveira31/SwiftUIWeb: Build web apps with familiar SwiftUI APIs, powered by Embedded Swift and WebAssembly, and rendered as native browser DOM. · GitHub](https://github.com/Vitorsilveira31/SwiftUIWeb)

**Live playground:** [https://swiftuiweb.vitorsilveira31.workers.dev/](https://swiftuiweb.vitorsilveira31.workers.dev/)

**Food Truck example:** [SwiftUIWeb/Examples/FoodTruck/README.md at main · Vitorsilveira31/SwiftUIWeb · GitHub](https://github.com/Vitorsilveira31/SwiftUIWeb/blob/main/Examples/FoodTruck/README.md)

Licensed under MPL-2.0. Contributions and feedback are very welcome!

---

<div class="post-metadata">

**Author:** ![yuriy-yarosh](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/yuriy-yarosh/32/47397_2.png) [@yuriy-yarosh](https://forums.swift.org/u/yuriy-yarosh)\
**Post date:** [November 15, 2026, 7:50am UTC](https://forums.swift.org/t/swiftuiweb-bringing-swiftui-to-the-browser-with-embedded-swift-and-webassembly/90754/2 "2026-11-15T07:50:58Z")

</div>

There here have been multiple efforts to unify cross-platform UI development in Swift

Like OpenSwiftUI [GitHub - OpenSwiftUIProject/OpenSwiftUI: Open source implementation of Apple's SwiftUI. · GitHub](https://github.com/OpenSwiftUIProject/OpenSwiftUI) and Skip [GitHub - skiptools/skip: Skip enables the creation of native SwiftUI apps for iOS and Android · GitHub](https://github.com/skiptools/skip)

Which essentially provide interoperability layers via code generation or compiler instrumentation.

I'd suggest taking a closer look at OpenSwiftUI.  
It already targets embedded ESP32, so adding WASM support through SwiftWASM shouldn't be challenging, considering what you've already implemented in your project.

It worth consolidating related efforts.

---

<div class="post-metadata">

**Author:** ![joehink](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/joehink/32/45590_2.png) [@joehink](https://forums.swift.org/u/joehink)\
**Post date:** [November 15, 2026, 8:53pm UTC](https://forums.swift.org/t/swiftuiweb-bringing-swiftui-to-the-browser-with-embedded-swift-and-webassembly/90754/3 "2026-11-15T20:53:49Z")

</div>

I just tried playground and this seems to be one of the better web implementations of SwiftUI. Nice job! I'm very happy to see it using embedded wasm.

The API looks to be identical to Apple's SwiftUI. I think ElementaryUI had to diverge from Apple's SwiftUI API to get it to work in embedded Swift. I prefer your approach of keeping it the same.

Do you plan to keep the API close/identical to Apple's SwiftUI?
