From zero to six native GPUs in minutes.
Install the MoonBit toolchain, scaffold an app with one command, draw its first frame and pack it for the web on WebGL 2.
Install, scaffold, run.
Prerequisites
The MoonBit toolchain, Git, and Node.js for the web target (it compresses assets and runs esbuild). Native packing also needs that platform's toolchain unless you use the prebuilt wasm runtime.
Scaffold & check
mbui init writes mbui.json, a moon.mod importing mbui, a moon.work naming your mbui checkout, and src/app with a first window. mbui check loads the manifest with every variant and override applied and prints what it resolved to.
Run & pack
Open the app in a macOS window, then pack it for the web: a static index.html, host.js and pre-compressed assets that draw on WebGL 2. Add more targets with a comma.
What mbui init writes in src/app
One window, made once as a tree. Change the words, rebuild, and read the docs on views and signals to make it react.
Views & signalsOne core, six thin hosts.
The same MoonBit core draws every pixel. Each host only puts frames on screen and feeds input, on the platform's own GPU API.
| Platform | GPU | Host | --target | Output |
|---|---|---|---|---|
| macOS | Metal | Objective-C · AppKit | mac | .app · .zip · .dmg |
| iOS | Metal | Objective-C · UIKit | ios | .app · .ipa |
| Android | OpenGL ES | C · Java | android | Signed APK |
| Windows | Direct3D 11 | C/C++ · Win32 | win | Portable · .zip · setup |
| Linux | OpenGL ES | C · GTK 4 | linux | .tar.gz · .deb · AppImage |
| Web | WebGL 2 | JavaScript · host.js | web | Static site · PWA · .gz/.br |
With --runtime wasm, the five native targets need no C, Xcode or MSVC per app: the app's .wasm goes into a prebuilt mbui-runtime shell.
Questions
What developers ask first. The docs go deeper on each.
Why MoonBit?
One language compiles to native C for every desktop and mobile host, to wasm for the prebuilt runtime shell and to JavaScript for the browser. The framework, its tools and its build checks are all written in it, so there is one toolchain from the first frame to the release.
Why draw on the GPU instead of the DOM or a WebView?
Because the same core draws the same pixels on every platform, a test can read exactly what will be drawn from the Tester's draw list, and motion can be computed for any moment. Layout, text and drawing are mbui's own: its flexbox passes Yoga's tests and its text segmentation passes Unicode's.
How big is the WebGL 2 bundle?
It depends on what your app includes, so measure it: libs/mbui/scripts/size.sh web reports app.js and host.js raw, gzip -9 and brotli -q 11, which is what a browser downloads. mbui pack minifies with esbuild and writes .gz and .br files next to each asset.
Can I bring my own design system on top of @headless?
Yes, that is what it is for. Each headless control takes a look function from its caller; a look library such as sf-ui or liquid-glass is just a set of those looks over the same behaviour. Write yours as a module beside mbui that imports only mbui.
How does deterministic UI testing work?
A Tester runs the tree against a fake host. Tests press, type and declare moments with run_for, then assert on the screen-reader tree or the draw list. Every test also runs at 60, 120, 24 and 7 fps and must give identical results, so there is nothing to wait for and nothing flaky to retry.
What are the licenses?
mbui and sf-ui are MIT. liquid-glass is a port of Kyant0/AndroidLiquidGlass and keeps its Apache-2.0 license. Third-party data, tests and code carried by mbui keep their own licenses, listed in THIRD_PARTY_NOTICES.md.
Your first frame is drawn. Keep going.
Learn how views, signals, motion and tests fit together, or browse the components you can build on.