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,24 @@
namespace Htmx.ApiDemo.Templates.Components;
/// <summary>
/// shadcn-style Separator component.
/// Orientation: horizontal | vertical
/// </summary>
public sealed class Separator : SeparatorBase
{
private readonly byte[] _classesData;
private readonly byte[] _orientationData;
public Separator(string orientation = "horizontal", string extraClasses = "")
{
var cls = orientation == "vertical"
? $"inline-block h-full w-px bg-border {extraClasses}"
: $"block h-px w-full bg-border {extraClasses}";
_classesData = cls.Trim().ToUtf8Bytes();
_orientationData = orientation.ToUtf8Bytes();
}
protected override void RenderClasses(HtmxRenderContext ctx) => ctx.Writer.WriteUtf8(_classesData);
protected override void RenderOrientation(HtmxRenderContext ctx) => ctx.Writer.WriteUtf8(_orientationData);
}