feat(theme): NavRailItem + NavRailSection

This commit is contained in:
Joseph Doherty
2026-06-01 04:47:36 -04:00
parent 8e70718ca4
commit a74ad7008d
3 changed files with 51 additions and 0 deletions
@@ -0,0 +1,12 @@
@* Components/NavRailItem.razor *@
<NavLink class="rail-link" href="@Href" Match="@Match" ActiveClass="active">
@if (Icon is not null) { <span class="rail-ico">@Icon</span> }
@Text
</NavLink>
@code {
[Parameter, EditorRequired] public string Href { get; set; } = string.Empty;
[Parameter, EditorRequired] public string Text { get; set; } = string.Empty;
[Parameter] public RenderFragment? Icon { get; set; }
[Parameter] public NavLinkMatch Match { get; set; } = NavLinkMatch.Prefix;
}
@@ -0,0 +1,12 @@
@* Components/NavRailSection.razor — CSS-only collapsible (no JS, works in static SSR).
Apps that want cookie-persisted expand state keep their own interactive NavSection. *@
<details class="rail-section" open="@Expanded">
<summary class="rail-eyebrow-toggle"><span class="rail-eyebrow-label">@Title</span></summary>
<div class="rail-section-body">@ChildContent</div>
</details>
@code {
[Parameter, EditorRequired] public string Title { get; set; } = string.Empty;
[Parameter] public bool Expanded { get; set; } = true;
[Parameter] public RenderFragment? ChildContent { get; set; }
}