Modrich.Navigation.Abstractions
0.1.0
dotnet add package Modrich.Navigation.Abstractions --version 0.1.0
NuGet\Install-Package Modrich.Navigation.Abstractions -Version 0.1.0
<PackageReference Include="Modrich.Navigation.Abstractions" Version="0.1.0" />
<PackageVersion Include="Modrich.Navigation.Abstractions" Version="0.1.0" />
<PackageReference Include="Modrich.Navigation.Abstractions" />
paket add Modrich.Navigation.Abstractions --version 0.1.0
#r "nuget: Modrich.Navigation.Abstractions, 0.1.0"
#:package Modrich.Navigation.Abstractions@0.1.0
#addin nuget:?package=Modrich.Navigation.Abstractions&version=0.1.0
#tool nuget:?package=Modrich.Navigation.Abstractions&version=0.1.0
Modrich.Navigation.Abstractions
Navigation + layout contracts for Modrich UI modules on .NET 10. UI modules (.Web RCL projects) reference this without pulling EF Core — the package is intentionally tiny.
What's in the box
IMainMenuProvider— contributes top-level entries (NavItem) to the host's main left navigation.IModuleMenuProvider— contributes a module's inner tab bar; activates when the request URL's first segment matchesRoutePrefix. CarriesResourceTypeso the layout can localizeMenuItem.TitleviaIStringLocalizer.JsonModuleMenuProvider—IModuleMenuProviderbacked by a JSON stream; ships with aFromEmbeddedResource(...)helper for loading the JSON from the module's own assembly.NavItem—Title,Href, optionalIcon,Group,Order,Roles,Permissions.MenuItem— supports leaves (Href) and parents (MenuItems), plusIcon,Permission,Order.
Install
dotnet add package Modrich.Navigation.Abstractions
Usage — main-menu entry per module
using Modrich.Navigation;
public sealed class OrdersMainMenuProvider : IMainMenuProvider
{
public IEnumerable<NavItem> GetNavItems() =>
[
new NavItem
{
Title = nameof(Strings.Orders),
Href = "/orders",
Icon = "shopping-cart",
Group = "Sales",
Order = 100,
Permissions = ["Module.Orders.Access"],
}
];
}
Register from the module:
public void RegisterAppDependencies(IServiceCollection services, IConfiguration configuration, string? apiBaseUrl = null)
{
services.AddSingleton<IMainMenuProvider, OrdersMainMenuProvider>();
}
The host enumerates every registered IMainMenuProvider, filters by Permissions/Roles, orders by Group then Order, and renders the result in its shell.
Usage — inner module menu from embedded JSON
menu.json in the module assembly, marked as EmbeddedResource:
[
{ "Title": "Overview", "Href": "/orders", "Icon": "list", "Order": 10 },
{ "Title": "New order", "Href": "/orders/new", "Icon": "plus", "Order": 20, "Permission": "Orders.Edit" },
{
"Title": "Reports",
"Order": 30,
"MenuItems": [
{ "Title": "Daily", "Href": "/orders/reports/daily" },
{ "Title": "Monthly", "Href": "/orders/reports/monthly" }
]
}
]
Register the provider:
services.AddSingleton<IModuleMenuProvider>(_ =>
JsonModuleMenuProvider.FromEmbeddedResource(
routePrefix: "orders",
resourceType: typeof(Strings),
assembly: typeof(OrdersAppModule).Assembly,
resourceName: "Acme.Orders.Web.menu.json"));
The host activates this provider when the URL begins with /orders, and resolves MenuItem.Title via IStringLocalizer.Create(resourceType).
Related packages
Modrich.Abstractions—LayoutSections,IModuleLayoutWidgetfor slotted widgets.Modrich.Sdk.Web— meta-package for.Webmodules; pulls this in.
Versioning
Strict semver — see Modrich.Abstractions. EnablePackageValidation is on.
License
MIT.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- No dependencies.
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Modrich.Navigation.Abstractions:
| Package | Downloads |
|---|---|
|
Modrich.Modularity
Package Description |
|
|
Modrich.Sdk.Web
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.