Skip to main content
.NETStandard2.0

Elmish integration for Fable.Lit. Unofficial build, republished from a fork while fixes are pending upstream.

Published
Aug 14, 2026
2mo ago
Total Downloads
2.5K
2,546

Install

dotnet add package Fable.Lit.Elmish.Unofficial --version 2.19.0
ProductVersions
.NET Standard
netstandard2.0

README

Fable.Lit.Elmish.Unofficial

Elmish loops driving lit templates.

dotnet add package Fable.Lit.Elmish.Unofficial

An Elmish program that renders into an element:

open Lit.Elmish

Program.mkProgram init update view
|> Program.withLit "app"
|> Program.run

Or a loop that belongs to one component, started and kept by it:

[<HookComponent>]
let Counter () =
    let model, dispatch = Hook.useElmish (init, update)
    view model dispatch

Beyond upstream

  • Program.withLitHydrated adopts markup that was rendered on the server by Lit.Server.Unofficial rather than replacing it, and Program.withLitHydratedInShadowRoot does the same inside a declarative shadow root.
  • Mounting twice on one element hands over instead of colliding, which is what a hot update is: the new program starts from the model the old one had reached.
  • Program.stopOn stops a program mounted on an element, disposing its subscriptions and closing the loop, so a dispatch afterwards cannot render into an element nobody is looking at.

Note that Hook.useElmish does not stop its program when the component disconnects: the model is disposed if it happens to be IDisposable, and nothing else. Subscriptions in a component outlive it unless you tear them down yourself, because disconnection cannot tell being moved from being removed.

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.

Changes from Previous Version

No structural changes between v2.18.0 and v2.19.0.

Adoption Assessment

Assess this package against its supported frameworks, license, maintenance signals and dependency graph before making it a project standard.

No SPDX license expression is published. Review the license text and your organisation's policy before redistribution.Compatibility metadata lists 1 target framework; confirm the exact target used by your application.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.