Giraffe.Htmx 1.8.6

.NET 6.0
dotnet add package Giraffe.Htmx --version 1.8.6
NuGet\Install-Package Giraffe.Htmx -Version 1.8.6
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="Giraffe.Htmx" Version="1.8.6" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Giraffe.Htmx --version 1.8.6
#r "nuget: Giraffe.Htmx, 1.8.6"
#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.
// Install Giraffe.Htmx as a Cake Addin
#addin nuget:?package=Giraffe.Htmx&version=1.8.6

// Install Giraffe.Htmx as a Cake Tool
#tool nuget:?package=Giraffe.Htmx&version=1.8.6


This package enables server-side support for htmx within Giraffe and ASP.NET's HttpContext.

htmx version: 1.8.6


  1. Install the package.
  2. Prior to using the request header extension properties or the header-setting HttpHandlers, open Giraffe.Htmx.


To obtain a request header, using the IHeaderDictionary extension properties:

  let myHandler : HttpHander =
    fun next ctx ->
      match ctx.HxPrompt with
      | Some prompt -> ... // do something with the text the user provided
      | None -> ... // no text provided

To set a response header:

  let myHandler : HttpHander =
    fun next ctx ->
      // some meaningful work
      withHxPushUrl "/some/new/url" >=> [other handlers]

The HxSwap module has constants to use for the HX-Reswap header. These may be extended with settle, show, and other qualifiers; see the htmx documentation for the hx-swap attribute for more information.


The naming conventions of this library were selected to mirror those provided by htmx. The header properties become Hx* on the ctx.Request.Headers object, and the response handlers are withHx* based on the header being set. The only part that does not line up is withHxTrigger* and withHxTriggerMany; the former set work with a single string (to trigger a single event with no arguments), while the latter set supports both arguments and multiple events.

Product Versions
.NET net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows net7.0 net7.0-android net7.0-ios net7.0-maccatalyst net7.0-macos net7.0-tvos net7.0-windows
Compatible target framework(s)
Additional computed target framework(s)
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
1.8.6 76 3/3/2023
1.8.5 3,330 1/18/2023
1.8.4 1,108 11/24/2022
1.8.0 2,215 7/14/2022
1.7.0 1,068 2/24/2022
1.6.1 184 1/7/2022
0.9.3 1,368 11/26/2021
0.9.2 227 11/11/2021
0.9.1 214 11/8/2021

Update script tags for htmx 1.8.6