FSharp.ViewEngine
2026.2.3
See the version list below for details.
dotnet add package FSharp.ViewEngine --version 2026.2.3
NuGet\Install-Package FSharp.ViewEngine -Version 2026.2.3
<PackageReference Include="FSharp.ViewEngine" Version="2026.2.3" />
<PackageVersion Include="FSharp.ViewEngine" Version="2026.2.3" />
<PackageReference Include="FSharp.ViewEngine" />
paket add FSharp.ViewEngine --version 2026.2.3
#r "nuget: FSharp.ViewEngine, 2026.2.3"
#:package FSharp.ViewEngine@2026.2.3
#addin nuget:?package=FSharp.ViewEngine&version=2026.2.3
#tool nuget:?package=FSharp.ViewEngine&version=2026.2.3
<p align="center"> <img src="etc/logo.svg" alt="FSharp.ViewEngine" width="128"> </p>
FSharp.ViewEngine
A minimal, fast view engine for F#. Inspired by Giraffe.ViewEngine, Feliz.ViewEngine, Oxpecker.ViewEngine, and Bolero.
FSharp.ViewEngine combines ideas from several F# view engines into a clean, unified DSL:
- Computation expression syntax (like Oxpecker.ViewEngine and Bolero) for building elements
- Feliz-style single sequence of attributes and child elements — no separate attribute and children lists
- Attributes prefixed with underscore by convention (like Giraffe.ViewEngine, e.g.
_class,_id,_hxGet), giving clean syntax and nice syntax highlighting - Mixed yielding in computation expressions — you can yield strings, elements, and attributes in any order without needing a special
_childrenattribute
The result is a DSL that is as minimal and fast as possible while remaining expressive and type-safe.
Documentation site built using FSharp.ViewEngine available at https://fsharpviewengine.meiermade.com.
See sln/src/Docs for the source code.
Installation
Add the core view engine package.
dotnet add package FSharp.ViewEngine
Usage
open FSharp.ViewEngine
open type Html
open type Htmx
open type Alpine
open type Datastar
open type Tailwind
html {
_lang "en"
head {
title "Test"
meta { _charset "utf-8" }
link { _href "/css/compiled.css"; _rel "stylesheet" }
}
body {
_xData "{showContent: false}"
_class "bg-gray-50"
div {
_id "page"
_class [ "flex"; "flex-col" ]
h1 { _hxGet "/hello"; _hxTarget "#page"; "Hello" }
h1 { _hxGet "/world"; _hxTarget "#page"; "World" }
}
br
div {
_xShow "showContent"
h2 { "Content" }
p { "Some content" }
ul {
li { "One" }
li { "Two" }
}
}
}
}
|> Render.toHtmlDocString
<!DOCTYPE html>
<html lang="en">
<head>
<title>Test</title>
<meta charset="utf-8">
<link href="/css/compiled.css" rel="stylesheet">
</head>
<body x-data="{showContent: false}" class="bg-gray-50">
<div id="page" class="flex flex-col">
<h1 hx-get="/hello" hx-target="#page">Hello</h1>
<h1 hx-get="/world" hx-target="#page">World</h1>
</div>
<br>
<div x-show="showContent">
<h2>Content</h2>
<p>Some content</p>
<ul>
<li>One</li>
<li>Two</li>
</ul>
</div>
</body>
</html>
Benchmarks
Ran on February 6, 2026 with BenchmarkDotNet MediumRun only.
Command:
cd sln && dotnet run -c Release --project src/Benchmarks/Benchmarks.fsproj
BuildAndRender (mean, lower is better): | Method | Mean | Allocated | |-------------- |----------:|----------:| | ViewEngineApi | 5.763 μs | 11.4 KB | | OxpeckerApi | 7.562 μs | 12.88 KB | | GiraffeApi | 7.925 μs | 23.95 KB | | FelizApi | 11.053 μs | 25.87 KB |
RenderOnly: | Method | Mean | Allocated | |-------------- |---------:|----------:| | ViewEngineApi | 2.464 μs | 2.94 KB | | OxpeckerApi | 2.796 μs | 2.94 KB | | GiraffeApi | 3.176 μs | 12.77 KB | | FelizApi | 6.151 μs | 14.2 KB |
BuildOnly: | Method | Mean | Allocated | |-------------- |---------:|----------:| | ViewEngineApi | 2.153 μs | 8.46 KB | | OxpeckerApi | 5.275 μs | 9.95 KB | | GiraffeApi | 7.323 μs | 11.17 KB | | FelizApi | 7.707 μs | 11.66 KB |
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. 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 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
- JetBrains.Annotations (>= 2025.2.4)
-
net8.0
- JetBrains.Annotations (>= 2025.2.4)
-
net9.0
- JetBrains.Annotations (>= 2025.2.4)
NuGet packages (4)
Showing the top 4 NuGet packages that depend on FSharp.ViewEngine:
| Package | Downloads |
|---|---|
|
FSharp.ViewEngine.Alpine
Package Description |
|
|
FSharp.ViewEngine.Html
Package Description |
|
|
FSharp.ViewEngine.Htmx
Package Description |
|
|
FSharp.ViewEngine.Svg
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2026.2.5 | 144 | 2/28/2026 |
| 2026.2.4 | 92 | 2/28/2026 |
| 2026.2.3 | 89 | 2/26/2026 |
| 2026.2.2 | 129 | 2/9/2026 |
| 2026.2.1 | 116 | 2/7/2026 |
| 2026.2.0 | 98 | 2/6/2026 |
| 2025.9.1 | 353 | 9/24/2025 |
| 2025.9.0 | 202 | 9/23/2025 |
| 2024.3.0 | 685 | 3/14/2024 |
| 2023.10.0 | 529 | 10/14/2023 |
| 2023.9.1 | 323 | 9/21/2023 |
| 2023.9.0 | 362 | 9/10/2023 |
| 2023.8.1 | 382 | 8/24/2023 |
| 2023.8.0 | 387 | 8/7/2023 |
| 2023.5.2 | 411 | 5/13/2023 |
| 2023.5.1 | 395 | 5/12/2023 |
| 2023.5.0 | 395 | 5/11/2023 |
| 0.1.0 | 600 | 5/10/2023 |