Firelight 0.2.0

dotnet add package Firelight --version 0.2.0
                    
NuGet\Install-Package Firelight -Version 0.2.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="Firelight" Version="0.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Firelight" Version="0.2.0" />
                    
Directory.Packages.props
<PackageReference Include="Firelight" />
                    
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 Firelight --version 0.2.0
                    
#r "nuget: Firelight, 0.2.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 Firelight@0.2.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=Firelight&version=0.2.0
                    
Install as a Cake Addin
#tool nuget:?package=Firelight&version=0.2.0
                    
Install as a Cake Tool

Firelight

Web Components for F#. Build reactive, standards-based UI components using Lit and Fable.

Firelight gives you idiomatic F# bindings to Lit's lightweight Web Components platform - type-safe reactive properties, composable templates, the Elmish MVU loop, and cross-component context - all compiling to lean, standards-compliant JavaScript.


Packages

Package Description
Firelight Core bindings: LitElement, html/css templates, directives, reactive properties
Firelight.Context Context protocol for sharing state across component trees without prop drilling
Firelight.Elmish Elmish (MVU) integration via reactive controllers

Quick Start

Define a component by inheriting LitElement, declare reactive properties, and implement render:

open Firelight
open Fable.Core.JsInterop

type Counter() =
    inherit LitElement()

    let mutable count = 0

    override _.render() =
        html $"""
            <p>Count: {count}</p>
            <button @click={fun _ -> count <- count + 1; base.requestUpdate()}>
                Increment
            </button>
        """

defineElement<Counter> "my-counter"

Use it anywhere in HTML:

<my-counter></my-counter>

Elmish Integration

For components with non-trivial state, Firelight.Elmish wires an Elmish Program directly to the component lifecycle:

open Firelight
open Firelight.Elmish

type Msg = Increment | Decrement

type Counter() =
    inherit LitElement()

    let elmish =
        ElmishController.simple(
            base,
            init = fun () -> 0,
            update = fun msg model ->
                match msg with
                | Increment -> model + 1
                | Decrement -> model - 1
        )

    override _.render() =
        let model = elmish.model
        html $"""
            <button @click={fun _ -> elmish.dispatch Decrement}>-</button>
            <span>{model}</span>
            <button @click={fun _ -> elmish.dispatch Increment}>+</button>
        """

defineElement<Counter> "my-counter"

Context

Firelight.Context lets you broadcast state (like an Elmish dispatch function) to any descendant component, regardless of nesting depth:

open Firelight.Context

// Define a typed context
let dispatchContext = LitContext.createContext<Symbol, Msg -> unit>()

// Provide it from a parent component
let provider = ContextProvider(host, dispatchContext, dispatch)

// Consume it in any descendant
let consumer = ContextConsumer(host, dispatchContext)

Documentation

Getting Started

See the GettingStarted sample for a guided walkthrough covering reactive properties, styles, events, controllers, context, and Elmish - each concept in its own focused module.


License

MIT

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  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 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on Firelight:

Package Downloads
Firelight.Context

Package Description

Firelight.Elmish

Package Description

Firelight.Router

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.2.0 143 4/7/2026
0.1.1 163 4/6/2026
0.1.0 238 7/12/2025