Lit.Server.Unofficial 2.19.0

dotnet add package Lit.Server.Unofficial --version 2.19.0
                    
NuGet\Install-Package Lit.Server.Unofficial -Version 2.19.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Lit.Server.Unofficial" Version="2.19.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Lit.Server.Unofficial" Version="2.19.0" />
                    
Directory.Packages.props
<PackageReference Include="Lit.Server.Unofficial" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Lit.Server.Unofficial --version 2.19.0
                    
#r "nuget: Lit.Server.Unofficial, 2.19.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Lit.Server.Unofficial@2.19.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Lit.Server.Unofficial&version=2.19.0
                    
Install as a Cake Addin
#tool nuget:?package=Lit.Server.Unofficial&version=2.19.0
                    
Install as a Cake Tool

Lit.Server.Unofficial

Render Fable.Lit templates to HTML on .NET — no Node, no @lit-labs/ssr.

dotnet add package Lit.Server.Unofficial

The same html $"..." view compiles to lit in the browser and to HTML on the server, because both sides resolve open Lit — one against this package, the other against Fable.Lit.Unofficial. No conditional compilation, no template written twice.

open Lit
open Lit.Server

let counter, _ = Views.Counter.init ()

// Plain HTML.
Server.render (Views.Counter.view counter ignore)

// HTML carrying lit's hydration markers, so the browser can adopt it
// with Hydrate.adopt or Program.withLitHydrated.
Server.renderHydratable (Views.Counter.view counter ignore)

Server.toNode and Server.toHydratableNode return a node rather than a string, for composing into HtmlTypeProvider templates without anything being escaped twice. Server.toShadowRootNode emits <template shadowrootmode="open"> with styles inside, which the parser attaches as a shadow root while it reads the page.

Event handlers are dropped on the server — a closure cannot be serialised — and become real listeners the moment lit adopts the markup.

There is a worked example at LitHydrationDemo.

This package has no Fable dependency: it is ordinary .NET, referenced by the server project.

Why "Unofficial"

This is a republished build of Fable.Lit by Alfonso García-Caro Núñez and its contributors, packaged from a fork so that fixes can be used before they land upstream. The toolchain is .NET 10, Fable 5, Fable.Core 4 and lit 3.

Reference this or upstream Fable.Lit, never both: they share the Lit namespace.

Product Compatible and additional computed target framework versions.
.NET 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.19.0 81 8/14/2026
2.18.0 75 8/14/2026
2.17.0 82 8/14/2026
2.16.0 82 8/14/2026
2.15.0 80 8/14/2026
2.14.0 87 8/13/2026
2.13.0 76 8/13/2026
2.12.0 74 8/13/2026
2.11.0 79 8/13/2026
2.10.0 77 8/13/2026
2.9.0 76 8/13/2026
2.8.0 80 8/13/2026
2.7.1 82 8/13/2026
2.7.0 79 8/13/2026
2.6.0 79 8/12/2026
2.5.0 95 8/12/2026
2.4.0 91 8/12/2026
2.3.0 88 8/12/2026

Unofficial fork of Fable.Lit. Toolchain moved to .NET 10, Fable 5, Fable.Core 4 and lit 3; event handlers no longer raise FS3884. See the repository for what differs from upstream.