MoonBit bindings for webview, a tiny library for creating web-based desktop GUIs.
Dependencies
⚠️ Note: This project is currently in active development. APIs may change in future releases.

moon update
moon add justjavac/webview{
"is-main": true,
"link": {
"native": {
"cc-flags": "-fwrapv -fsanitize=address -fsanitize=undefined",
"cc-link-flags": "-L .mooncakes/justjavac/webview/lib -lwebview"
}
}
}export DYLD_LIBRARY_PATH="$(pwd)/.mooncakes/justjavac/webview/lib"set _CL_=/link /LIBPATH:.mooncakes\justjavac\webview\lib webview.lib /DEBUG
set PATH=%PATH%;.mooncakes\justjavac\webview\lib$env:_CL_="/link /LIBPATH:.mooncakes\justjavac\webview\lib webview.lib /DEBUG"
$env:PATH="$env:PATH;.mooncakes\justjavac\webview\lib"export LD_LIBRARY_PATH="$(pwd)/.mooncakes/justjavac/webview/lib:$LD_LIBRARY_PATH"let html =
#| <html>
#| <head>
#| <title>MoonBit WebView</title>
#| <style>
#| body {
#| font-family: system-ui, -apple-system, sans-serif;
#| display: flex;
#| justify-content: center;
#| align-items: center;
#| height: 100vh;
#| margin: 0;
#| background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
#| color: white;
#| }
#| h1 { text-align: center; font-size: 2.5em; }
#| </style>
#| </head>
#| <body>
#| <h1>Hello, MoonBit WebView! 🌙</h1>
#| </body>
#| </html>
fn main {
@webview.Webview::new(debug=1)
..set_title("MoonBit WebView Example")
..set_size(800, 600, @webview.SizeHint::None)
..set_html(html)
..run()
}moon run --target native -C examples <example_name>cmake -G Ninja -B build -S . -D CMAKE_BUILD_TYPE=Release
cmake --build build# macOS
export DYLD_LIBRARY_PATH="$(pwd)/lib"
# Windows (Command Prompt)
set _CL_=/link /LIBPATH:lib webview.lib /DEBUG
set PATH=%PATH%;lib
# Windows (PowerShell)
$env:_CL_="/link /LIBPATH:lib webview.lib /DEBUG"
$env:PATH="$env:PATH;lib"
# Linux
export LD_LIBRARY_PATH="$(pwd)/lib:$LD_LIBRARY_PATH"moon update
moon install
moon run --target native -C examples 02_localmoon test --target nativeMoonBit bindings for webview, a tiny library for creating web-based desktop GUIs.
Dependencies