You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
4
4
5
5
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/).
6
6
7
+
## [0.3.0] - 2025-07-11
8
+
9
+
### Added
10
+
11
+
- HttpContext extensions to check htmx request headers
This small helper library seamlessly combines HTMX with the latest Razor Components in the ASP.NET Core world. With this library, you can effortlessly return HTML through Minimal API endpoints, which is then rendered by Razor Components. Streamline development by harnessing the power of HTMX alongside the flexibility of Razor Components and Minimal APIs.
5
+
This small helper library seamlessly combines HTMX with the latest Razor Components in the ASP.NET Core world. With this
6
+
library, you can effortlessly return HTML through Minimal API endpoints, which is then rendered by Razor Components.
7
+
Streamline development by harnessing the power of HTMX alongside the flexibility of Razor Components and Minimal APIs.
6
8
7
9
## Features
8
10
@@ -12,12 +14,15 @@ This small helper library seamlessly combines HTMX with the latest Razor Compone
12
14
13
15
## Installation
14
16
15
-
To use RazorHx in your ASP.NET Core project, you only need to install the NuGet package. Open your project in the Package Manager Console and run the following command:
17
+
To use RazorHx in your ASP.NET Core project, you only need to install the NuGet package. Open your project in the
18
+
Package Manager Console and run the following command:
19
+
16
20
```bash
17
21
Install-Package RazorHx
18
22
```
19
23
20
24
Alternatively, you can use the .NET CLI with the following command:
25
+
21
26
```bash
22
27
dotnet add package RazorHx
23
28
```
@@ -42,15 +47,46 @@ app.MapGet("/", () => new RazorHxResult<Hello>());
42
47
app.Run();
43
48
```
44
49
45
-
### "Out of Band" Components
50
+
### Triggers
51
+
52
+
[Read more at the official documentation site.](https://htmx.org/docs/#triggers)
53
+
54
+
Create an endpoint which returns a RazorHxResult and append the WithTrigger extension to specify the event to trigger:
55
+
56
+
```csharp
57
+
app.MapGet("/", () =>newRazorHxResult<Hello>()
58
+
.WithTrigger("event"));
59
+
```
60
+
61
+
Specify the timing, when the event should trigger:
Specify the condition, when the event should be included:
71
+
72
+
```csharp
73
+
app.MapGet("/", () =>newRazorHxResult<Hello>()
74
+
.WithTrigger("event", include: false));
75
+
```
76
+
77
+
### Out of Band Swaps
78
+
79
+
[Read more at the official documentation site.](https://htmx.org/docs/#oob_swaps)
46
80
47
81
Create an endpoint which returns a RazorHxResult and append the WithOutOfBand extension to specify your oob component:
82
+
48
83
```csharp
49
84
app.MapGet("/", () =>newRazorHxResult<Hello>()
50
85
.WithOutOfBand<World>());
51
86
```
52
87
53
-
Define a slot in the DOM where the response will be swapped to:
88
+
Define a slot in the DOM where the response will be swapped to:
89
+
54
90
```html
55
91
<!-- Hello.razor or somewhere in Layouts -->
56
92
<divid="oob">
@@ -73,7 +109,8 @@ For a detailed changelog, please refer to the [CHANGELOG.md](CHANGELOG.md) file.
73
109
74
110
## Contributing
75
111
76
-
We welcome contributions and feedback on these planned features. If you have specific features you'd like to see or would like to contribute to the development, please check our [contribution guidelines](CONTRIBUTING.md)
112
+
We welcome contributions and feedback on these planned features. If you have specific features you'd like to see or
113
+
would like to contribute to the development, please check our [contribution guidelines](CONTRIBUTING.md)
0 commit comments