Script native UI without a WebView
JavaScript.Avalonia
Give native Avalonia controls a browser-like scripting model while keeping the host fully managed.
Explore source ↗Capability
A standalone Jint-powered runtime exposes window, document, DOM queries and mutation, routed events, timers, animation frames, CommonJS modules, HTTP/assets, and embedded TypeScript transpilation to any Avalonia TopLevel.
- 01
DOM queries and native tree mutation
- 02
Capture, target, and bubble event phases
- 03
TypeScript and CommonJS modules
- 04
Timers and requestAnimationFrame
How it composes
From intent
to working system.
Host
JintAvaloniaHost owns engine lifetime and binds an Avalonia TopLevel.
Document
DOM wrappers traverse, create, mutate, and identify native controls.
Events
Avalonia routed events become DOM-style capture, target, and bubble callbacks.
Runtime
Modules, assets, TypeScript, timers, animation, and host functions support complete scripts.
Quick start
Adopt this
capability.
Start with the primary module, then add the related packages only when the application needs those layers. Replace VERSION with the current NuGet version.
git clone https://github.com/wieslawsoltes/HtmlML.git# Add a ProjectReference to src/JavaScript.Avalonia/JavaScript.Avalonia.csproj.var host = new JintAvaloniaHost(this);host.ExecuteScriptText("""const button = document.getElementById('RunButton');const output = document.getElementById('OutputText');
button.addEventListener('click', () => { output.textContent = 'Handled from JavaScript';});""");Modules in this capability
Use one layer.
Compose the rest.
Source of truth
Read the module beside the complete system.
The implementation, samples, issues, and release notes stay in the parent repository so module details remain connected to the product architecture.