Skip to content

App (Desktop GUI)

Build desktop apps with HTML, CSS, and system fonts. Uses the native OS webview (WebKit on macOS, WebKitGTK on Linux, Edge WebView2 on Windows).

No Electron. No browser. Just a native window with a webview. Your binary stays small.

Quick Start

wyn
fn main() {
    App.create("My App", 800, 600)
    App.html("<h1>Hello from Wyn!</h1><p>System fonts. CSS styling.</p>")
    App.run()
    App.destroy()
}

Build and run:

bash
wyn build app.wyn && ./app

API

MethodDescription
App.create(title, width, height) -> intCreate a native window with webview
App.html(content)Set HTML content
App.url(url)Navigate to a URL
App.eval(js)Execute JavaScript in the webview
App.set_title(title)Change window title
App.run()Run the event loop (blocking)
App.destroy()Close the window

Examples

Text Editor

wyn
fn main() {
    App.create("Editor", 900, 650)
    App.html("<textarea style='width:100%;height:100vh;font-family:monospace;font-size:14px;background:#1e1e2e;color:#cdd6f4;border:none;padding:16px'></textarea>")
    App.run()
}

Dashboard with Live Data

wyn
fn main() {
    var cpu = System.exec("...").trim()
    App.create("Dashboard", 800, 500)
    App.html("<h1>CPU: " + cpu + "%</h1>")
    App.run()
}

How It Works

App.create opens a native OS window containing a webview. On macOS, this is WKWebView (the same engine Safari uses). Your HTML/CSS/JS runs in the webview with full access to system fonts, CSS animations, flexbox, grid — everything a modern browser supports.

The Wyn binary handles the backend logic. The webview handles the UI. No runtime to install, no browser to bundle. A hello-world App binary is ~33KB.

Platform Support

PlatformBackendStatus
macOSWebKit (WKWebView)✅ Working
LinuxWebKitGTKPlanned
WindowsEdge WebView2Planned

MIT License