feat(theme): NavRailItem + NavRailSection
This commit is contained in:
@@ -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; }
|
||||
}
|
||||
Reference in New Issue
Block a user