ElementaryUI - Swift, in the browser.

ElementaryUI

1 min read Original article ↗

Skip to content

ElementaryUISwift, in the browser.

  • 🌐

    Run declarative Swift applications natively in the browser with WebAssembly

  • 🎨

    SwiftUI-inspired APIs

    Familiar and intuitive syntax for building web UIs

  • 💫

    Built-in Reactivity

    Automatic state management with @State, @Environment, and @Reactive

  • 📦

    Tiny Binaries

    Full Embedded Swift support means kB-sized wasm bundles instead of MB

  • ✨

    Magical Animations

    Powerful CSS-based animation system including automatic FLIP transitions

  • 🚀

    Vite-Powered Development

    Fast dev server with hot reload for rapid iteration

swift

@View
struct LoveCounter {
    @State var count = 1

    var body: some View {
        p { String(repeating: "❤️", count: count) }

        if count < 10 {
            button { "More Love" }
                .onClick { count += 1 }
        } else {
            p { "Enough love for you!" }
            button { "Less Love" }
                .onClick { count = 1 }
        }
    }
}

Thank you to everyone supporting this open‑source project financially.
Please consider joining them by sponsoring ElementaryUI.