Write pages like a website. Ship a website and native apps.
Duolith compiles one set of page files, with markup, scoped styles and TypeScript, to a fast website and to real native iOS and Android apps. No web view, no second codebase.This page is the example
The page you are reading is a Duolith page. The compiler saw that nothing on it changes, so it wrote the HTML itself and shipped no runtime and no script file. Add a button that counts and the same file ships the runtime it needs.12.4 KBthis whole page over the network, gzip
4requests to show it
0script files to download
32 msto first paint on a 4-core test machine
A page is one file
Script at the top, markup below, styles beside them. This is a whole app: it runs in the browser, and as native views on a phone.---import { state } from "@duolith/client"; let count = state(0);--- <screen title="Counter" class="p-6 gap-4 items-center"> <text class="text-title">Pressed {count} times</text> <button on:press={() => count = count + 1}>Press me</button></screen>
With its state and its button, that app is 94 KB gzip, runtime included, and shows its first screen in 206 ms on the same test machine.Everything an app needs, built in
Native, not a web view
Pages compile to native views on iOS and Android through the Lynx engine, and to plain HTML, CSS and modules on the web.Mistakes fail the build
238 error codes, each with an explanation and a fix. What the compiler can know is an error before anything runs.Pay only for what a page does
A page with no state is written as HTML with no runtime. The build report says what each route ships, and why.Styling from one theme
Utility classes from theme tokens, light and dark, scoped styles per page, and a platform look on iOS and Android.Data that loads, writes and waits
State that loads, optimistic actions, retries, live streams and an offline queue that replays when the network is back.Made for coding agents
llms.txt, 21 topic packs of rules and skills, and a tool server, so an agent writes code that builds the first time.One stone, two faces
A Duolith is one stone with two faces. You write the pages once, the compiler cuts them into a website and a native app, and every rule that can be checked is checked before you ship. 122 decision records say why each part is the way it is, and 68 conformance fixtures hold the compiler to them.This page is HTML and CSS written by the Duolith compiler. It downloads no script.