# SbNavItem A navigation link item component with active state detection. ## Parameters | Parameter | Type | Default | Description | |-----------|------|---------|-------------| | Href | string? | null | Navigation URL | | Text | string? | null | Navigation text | | Match | NavLinkMatch | Prefix | URL matching behavior (All or Prefix) | | Disabled | bool | false | Whether the item is disabled | | Class | string? | null | Additional CSS classes | | Style | string? | null | Inline styles | | AdditionalAttributes | Dictionary\? | null | Additional HTML attributes | ## Templates / Slots | Slot | Type | Description | |------|------|-------------| | Icon | RenderFragment | Icon content displayed before text | | Badge | RenderFragment | Badge content displayed after text | ## CSS Classes - `sb-nav-item` - Base class - `sb-nav-item--active` - When the current URL matches - `sb-nav-item--disabled` - When item is disabled - `sb-nav-item__icon` - Icon container - `sb-nav-item__text` - Text container - `sb-nav-item__badge` - Badge container ## URL Matching - **Prefix** (default): Item is active if current URL starts with `Href` - **All**: Item is active only if current URL exactly matches `Href` ## Examples ### Basic Usage ```razor ``` ### With Icon ```razor ``` ### With Badge ```razor ``` ### Exact URL Match ```razor @* Only active when URL is exactly "/" *@ @* Active when URL starts with "/users" (e.g., /users, /users/123) *@ ``` ### Disabled Item ```razor @code { private bool isPremiumUser = false; } ``` ### Navigation Menu Example ```razor ``` ### Icon-Only (for collapsed sidebar) ```razor ``` ### With Custom Styling ```razor ``` ### Dynamic Navigation ```razor @foreach (var item in navigationItems) { @if (item.BadgeCount > 0) { } } @code { private List navigationItems = new() { new() { Url = "/", Title = "Home", Icon = "home", HasAccess = true }, new() { Url = "/users", Title = "Users", Icon = "users", HasAccess = true, BadgeCount = 5 }, new() { Url = "/admin", Title = "Admin", Icon = "shield", HasAccess = isAdmin } }; } ```