Tokamak is an open source framework that aims to replicate a large portion of Apple’s SwiftUI API in order to enable developers to build user interfaces that can run in the browser through WebAssembly as well as on native platforms. It provides a declarative programming model similar to SwiftUI, allowing developers to define views, state, and layout logic using familiar patterns while targeting environments beyond Apple’s ecosystem. The project includes a DOM renderer capable of handling a subset of SwiftUI views and modifiers, alongside additional constructs such as custom HTML rendering for greater flexibility when interacting with web technologies. Tokamak also introduces features like dynamic HTML elements with event listeners and direct DOM manipulation capabilities, which bridge the gap between Swift abstractions and browser-level control. Its architecture draws inspiration from modern UI frameworks.
Features
- SwiftUI-compatible declarative API
- WebAssembly support for browser apps
- Custom HTML rendering capabilities
- Dynamic DOM event handling
- Fiber-inspired rendering reconciler
- Cross-platform support including native targets