If you are a .NET developer building products across web, mobile, and desktop, you usually have to pick your trade-off:
- Maintain separate stacks: C# on the backend, React or TypeScript on the web, and Swift, Kotlin, or Dart for mobile.
- Blazor WASM: stay in C#, but ship the .NET runtime to the browser and pay for it in the first download.
- WebView wrappers: share UI code across desktop and mobile, but give up native rendering and the platform's feel.
Since January, I have been building eQuantic.UI, an open-source UI SDK for .NET 10 designed to remove these trade-offs. The idea is simple: write your components once, in strongly typed C#, against a declarative visual vocabulary, and let the SDK realize each target through its own real rendering path.
One C# codebase. Real web. Real native.
You can try it right now in the browser playground: write a component, press Run, and watch it render, with nothing to install. The source is on GitHub.
What the Code Looks Like
In eQuantic.UI, there is no Razor, no XAML, no HTML templates, and no CSS files. Everything is C#, from layout and state to strongly typed styles:
[Page("/", Title = "MyApp")]
public sealed class HomePage : StatefulComponent
{
private int _count;
public override VisualNode Build(ComponentContext context)
{
var theme = context.Theme;
return Box(new BoxStyle
{
Width = SizeValue.Fill,
Height = SizeValue.Fill,
Background = theme.Background,
Padding = EdgeInsets.All(Space.S6),
},
Column(gap: Space.S4, children: [
Text("MyApp", TypeRole.Display, theme.TextPrimary),
Row(gap: Space.S3, children: [
Button("Count", onPressed: () => SetState(() => _count++)),
Button("Reset", Variant.Outline, onPressed: () => SetState(() => _count = 0)),
]),
Text($"Clicked {_count} times", TypeRole.Caption, theme.TextMuted),
]));
}
}
The same component renders as a server-rendered, hydrated web page and inside a native window. What changes is the head project, not the component. A web app (eQuantic.UI.Sdk) routes it with [Page], and a native app (eQuantic.UI.Sdk.Native) names its root component in Program.cs.
How It Works Under the Hood
Instead of forcing one runtime everywhere, the SDK gives each target its own path:
1. Web Without WebAssembly
On the web, eQuantic.UI does not ship the .NET runtime to the browser. At build time, its compiler, built on Roslyn's semantic model rather than the syntax tree alone, translates your components to TypeScript and then to plain JavaScript, one module per page, with code splitting. The page loads a small runtime whose gzipped size is a budget the test suite enforces.
-
Fidelity is tested, not assumed: a conformance suite runs every case under .NET and in the browser's JavaScript engine. What the compiler cannot translate faithfully fails the build with a diagnostic, instead of answering differently at runtime. Integer widths,
floatrounding, pattern matching, and even LINQ's lazy evaluation behave as they do in .NET. - SSR + hydration: pages render on the server first, for fast first loads and SEO, then hydrate in the browser.
- Typed styles, no CSS: styles are C# values (colours as tokens, spacing, type roles) that the server lowers to deduplicated atomic CSS classes.
-
Built-in RPC: a method marked
[ServerAction]is callable from a UI event as a typed call, with[Authorize]enforced on the server. No REST controller boilerplate. - Hot reload that keeps your state: an edit reaches the browser in about half a second (the warm median CI measures on every merge), with the page's fields kept.
- Only the .NET SDK: no Node.js, npm, webpack, or Vite. The bundler ships embedded, as a per-OS NuGet package the SDK adds by itself.
2. Native GPU Rendering via Photon (No WebView, No Skia)
On macOS, iOS, Android, and Windows, the same component tree renders in a native window through Photon, a GPU engine of our own over Metal and Vulkan, with a CPU reference backend for tests.
- There is no embedded browser or WebView layer.
- Shapes, selection marks, focus rings, and editing carets are drawn by shaders written once in Slang and compiled to Metal and SPIR-V. Text comes from each platform's own engine.
- Photon is the experimental track for now: the 1.0 we are working toward promises the web SDK as stable, and marks the native assemblies experimental.
3. Transactional Email as a Target
Because components are built against an abstract vocabulary (Box, Row, Column, Text, Stack, ScrollView, Overlay), the SDK also includes an email realizer. The part of the vocabulary an email client can hold becomes email-safe HTML tables with inline styles, and the plain-text version comes from the same component tree.
Zero-Boilerplate Project Setup
The project file names the SDK and nothing else:
<Project Sdk="eQuantic.UI.Sdk">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>
The SDK's version lives in global.json, which the template writes. There are no Info.plist or AndroidManifest.xml files to maintain: a declaration in C#, such as builder.Capabilities.UseCamera("why"), becomes the platform's entry at build time. Localization is checked at build time too. A call that passes fewer arguments than its .resx template has placeholders, or a translation whose {0} and {1} do not match the neutral resource, fails the build instead of breaking a page.
To try it locally with the .NET 10 SDK:
dotnet new install eQuantic.UI.Templates
# Create a web app
dotnet new equantic-app -n MyApp
cd MyApp && dotnet run
# Or create a native GPU window app
dotnet new equantic-native -n MyNativeApp
cd MyNativeApp && dotnet run
Current Status and Feedback
eQuantic.UI is MIT-licensed and in active development: 0.2.0-preview.69 is on NuGet, and we are working toward a 1.0 with a stable web SDK.
If you work with .NET, compilers, or graphics programming, I would love to hear your thoughts:
- What edge cases do you think are trickiest when transpiling C# to JavaScript?
- Which native controls or layout primitives would you expect first in a custom GPU UI engine?
The architecture docs, samples, and roadmap are on GitHub: github.com/eQuantic/equantic-ui
Top comments (0)