Natrix.JSCore
0.2.0
dotnet add package Natrix.JSCore --version 0.2.0
NuGet\Install-Package Natrix.JSCore -Version 0.2.0
<PackageReference Include="Natrix.JSCore" Version="0.2.0" />
<PackageVersion Include="Natrix.JSCore" Version="0.2.0" />
<PackageReference Include="Natrix.JSCore" />
paket add Natrix.JSCore --version 0.2.0
#r "nuget: Natrix.JSCore, 0.2.0"
#:package Natrix.JSCore@0.2.0
#addin nuget:?package=Natrix.JSCore&version=0.2.0
#tool nuget:?package=Natrix.JSCore&version=0.2.0
Natrix
Natrix is a .NET WebAssembly toolkit for building browser applications in C#. It combines a JavaScript interop foundation, generated browser API bindings, and an experimental component layer for reactive UI rendering.
The repository is split into a few focused projects:
- src/Natrix.JSCore provides the JavaScript proxy system, type marshalling, and low-level interop utilities.
- src/Natrix.StdWeb contains generated C# bindings for standard Web APIs such as DOM, Fetch, Canvas, WebGL, and related browser interfaces.
- src/Natrix.Core contains the component model, DOM components, render roots, and feature infrastructure.
- src/Natrix.Ssr contains server-side rendering helpers for ASP.NET Core hosted Natrix applications.
- src/Natrix.CoreExample is a browser WebAssembly client app that exercises the Core component layer.
- src/Natrix.Signals provides reactive primitives used by the component layer.
- src/Natrix.WebIDLGenerator generates C# bindings from WebIDL definitions.
Documentation
- src/Natrix.StdWeb/README.md explains the generated browser API bindings and direct DOM-style usage.
- src/Natrix.Core/README.md explains the component framework and rendering model.
- examples/README.md describes the runnable sample applications.
Quick Start
Create a WebAssembly browser project and reference the Natrix package that matches the layer you want to use:
dotnet new wasmbrowser
dotnet add package Natrix.StdWeb
For direct browser API access, initialize StdWeb and get typed proxies for browser globals:
using System.Runtime.InteropServices.JavaScript;
using Natrix.JSCore;
using Natrix.StdWeb;
await StdWebProxyFactory.InitializeAsync();
var window = JSObjectProxyFactory.GetProxy<Window>(JSHost.GlobalThis);
var document = window.Document;
var div = document.CreateElement("div");
div.TextContent = "Hello from Natrix";
document.Body?.AppendChild(div);
See src/Natrix.StdWeb/README.md for the full StdWeb overview. For component-based browser client apps, see src/Natrix.Core/README.md.
You can also bootstrap a docs-style Natrix app (server + client + Tailwind) with the template package:
dotnet new install Natrix.Templates
dotnet new natrix -n MyNatrixApp
dotnet run --project MyNatrixApp/MyNatrixApp.csproj
Examples
The examples directory contains package-based examples:
- examples/Natrix.TodoExample shows dynamic DOM rendering and keyboard events.
- examples/Natrix.CanvasExample shows Canvas API usage and animation.
Run an example from its directory:
cd examples/Natrix.TodoExample
dotnet run
Requirements
- .NET 9.0 or later
- Browser with WebAssembly support
Status
Natrix is under active development. APIs may change as the core abstractions, generated bindings, and packaging mature.
License
This project is licensed under the MIT License. See LICENSE for details.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- No dependencies.
-
net9.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Natrix.JSCore:
| Package | Downloads |
|---|---|
|
Natrix.StdWeb
Auto-generated strongly-typed C# wrappers for standard Web APIs (DOM, Fetch, Canvas, WebGL, etc.) for Natrix WebAssembly framework. Based on official W3C WebIDL specifications. |
GitHub repositories
This package is not used by any popular GitHub repositories.