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
Parent systemHtmlML
StatusPreview
Modules1
RepositoryHtmlML/JavaScript.Avalonia

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.

  1. 01

    DOM queries and native tree mutation

  2. 02

    Capture, target, and bubble event phases

  3. 03

    TypeScript and CommonJS modules

  4. 04

    Timers and requestAnimationFrame

From intent
to working system.

01

Host

JintAvaloniaHost owns engine lifetime and binds an Avalonia TopLevel.

02

Document

DOM wrappers traverse, create, mutate, and identify native controls.

03

Events

Avalonia routed events become DOM-style capture, target, and bubble callbacks.

04

Runtime

Modules, assets, TypeScript, timers, animation, and host functions support complete scripts.

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.

01 · Install
Terminal
git clone https://github.com/wieslawsoltes/HtmlML.git
# Add a ProjectReference to src/JavaScript.Avalonia/JavaScript.Avalonia.csproj.
02 · Use · csharp
QuickStart.cs
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';
});
""");

Use one layer.
Compose the rest.

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.

HtmlML

Search everything.

Loading the index…

move open esc close

Preparing metadata and full-text search…