Web UI is the framework I built to run my company's websites, including this one. It started in 2022 as a Rust framework that rendered the UI in WebAssembly. In 2024 I rebuilt it as vanilla JavaScript web components, with Rust kept for the heavy processing it is good at. Today about two dozen websites run on it from one shared CDN, and every deploy is gated by automated tests.
This page covers the problem, the decision to rebuild, the design, and how it is kept reliable.
I run about two dozen websites through Stoic Dreams. Each one needs the same things: navigation, drawers, a header and footer, page routing, forms, data binding, and accessibility. Rebuilding that on every site, or copying it between sites, multiplies the code I have to maintain by the number of sites.
I wanted a new site to start with almost no boilerplate, and a fix in shared code to reach every site at once.
The first version, started in September 2022, was a Rust library built on the Yew framework, compiled to WebAssembly. Within the first two weeks I replaced Yew's router with my own navigation system, and the library grew to cover the shared layout and components for my sites.
It worked, but it had Rust building HTML. The rebuild followed a different principle: Rust should not build or manage the UI. It belongs in a worker thread doing long-running or processing-heavy work, while the UI stays in HTML, CSS, and JavaScript, the languages the browser was built around.
In May 2024 I began a vanilla JavaScript loader for web components, and in June 2024 I moved the framework over to it and retired the Rust rendering.
The design that came out of the rebuild:
<webui-cards>, and the loader fetches that component's script the first time the tag appears. Sites don't import or bundle anything. A site adds its own components with an app- prefix, and they load the same way from the site.data-subscribe, data-trigger, and data-bind, so most interactive pages need no page-specific JavaScript.webui.worker. The browser tools on Ap Tul use this to process files on the device instead of uploading them.The framework now has about 70 components, from layout pieces like drawers and tabs to forms, tables, and dialogs.
When every site loads the same framework, a mistake in the framework is a mistake on every site. That makes testing the core of the design, not an extra:
webui method has no tests, so new code can't skip them.Run on one framework and one CDN, including this site, Ap Tul, and Task Proxy.
A page is one markdown file. A layout used across sites becomes one component, instead of markup and CSS copied into each page.
No site deploys unless its tests pass, and the framework can't add a component or method without tests.
Web UI documentation Web UI on GitHub More projects
You can also come chat with us on the Stoic Dreams discord server.