Created more components

This commit is contained in:
2026-05-04 18:58:48 +05:00
parent fb1cb8e834
commit 40a7d9018c
52 changed files with 2526 additions and 11 deletions
@@ -0,0 +1,20 @@
namespace Htmx.ApiDemo.Templates.Components;
/// <summary>
/// Fixed viewport container for toast notifications.
/// Place once in the page (or layout). Toasts appear via window.showToast() from components.js.
/// </summary>
public sealed class ToastViewport : ToastViewportBase
{
private readonly byte[] _idData;
private readonly byte[] _toastsData;
public ToastViewport(string id = "toast-viewport")
{
_idData = id.ToUtf8Bytes();
_toastsData = [];
}
protected override void RenderId(HtmxRenderContext ctx) => ctx.Writer.WriteUtf8(_idData);
protected override void RenderToasts(HtmxRenderContext ctx) => ctx.Writer.WriteUtf8(_toastsData);
}