> ## Documentation Index
> Fetch the complete documentation index at: https://easyaf.nimbleapps.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# NavigationItem

> Defines an app navigation structure suitable for binding to navigation menus.

## Definition

**Assembly:** CloudNimble.BlazorEssentials.dll

**Namespace:** CloudNimble.BlazorEssentials.Navigation

**Inheritance:** CloudNimble.BlazorEssentials.InterfaceElement

## Syntax

```csharp theme={"dark"}
CloudNimble.BlazorEssentials.Navigation.NavigationItem
```

## Summary

Defines an app navigation structure suitable for binding to navigation menus.

## Constructors

### &#x20;.ctor

#### Syntax

```csharp theme={"dark"}
public NavigationItem()
```

### &#x20;.ctor

Creates a new instance with the minimum-required items to render a Blazor NavLink.

#### Syntax

```csharp theme={"dark"}
public NavigationItem(string text, string icon, string url)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `text` | `string` | A string representing the text that will be displayed in the NavBar. |
| `icon` | `string` | A string representing the CSS class(es) for the icon that can be displayed next to the [InterfaceElement.DisplayText](https://easyaf.nimbleapps.cloud/blazoressentials/api-reference/CloudNimble/BlazorEssentials/InterfaceElement.md#displaytext). |
| `url` | `string` | A string corresponding to the route for this [NavigationItem](https://easyaf.nimbleapps.cloud/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem.md). |

### &#x20;.ctor

#### Syntax

```csharp theme={"dark"}
public NavigationItem(string text, string icon, string url, string category)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `text` | `string` | A string representing the text that will be displayed in the NavBar. |
| `icon` | `string` | A string representing the CSS class(es) for the icon that can be displayed next to the [InterfaceElement.DisplayText](https://easyaf.nimbleapps.cloud/blazoressentials/api-reference/CloudNimble/BlazorEssentials/InterfaceElement.md#displaytext). |
| `url` | `string` | A string corresponding to the route for this [NavigationItem](https://easyaf.nimbleapps.cloud/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem.md). |
| `category` | `string` | A string representing the parent category for this [NavigationItem](https://easyaf.nimbleapps.cloud/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem.md). Can be useful for grouping |
| [NavigationItem](https://easyaf.nimbleapps.cloud/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem.md)NavigationItems\</see> into caregories for display. | | |

### &#x20;.ctor

#### Syntax

```csharp theme={"dark"}
public NavigationItem(string text, string icon, string url, string category, bool isVisible)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `text` | `string` | A string representing the text that will be displayed in the NavBar. |
| `icon` | `string` | A string representing the CSS class(es) for the icon that can be displayed next to the [InterfaceElement.DisplayText](https://easyaf.nimbleapps.cloud/blazoressentials/api-reference/CloudNimble/BlazorEssentials/InterfaceElement.md#displaytext). |
| `url` | `string` | A string corresponding to the route for this [NavigationItem](https://easyaf.nimbleapps.cloud/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem.md). |
| `category` | `string` | A string representing the parent category for this [NavigationItem](https://easyaf.nimbleapps.cloud/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem.md). Can be useful for grouping |
| [NavigationItem](https://easyaf.nimbleapps.cloud/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem.md)NavigationItems\</see> into caregories for display. | | |
| `isVisible` | `bool` | Specifies whether or not this [NavigationItem](https://easyaf.nimbleapps.cloud/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem.md) is visible on the NavBar. |

### &#x20;.ctor

#### Syntax

```csharp theme={"dark"}
public NavigationItem(string text, string icon, string category, bool isVisible, System.Collections.Generic.List<CloudNimble.BlazorEssentials.Navigation.NavigationItem> children)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `text` | `string` | A string representing the text that will be displayed in the NavBar. |
| `icon` | `string` | A string representing the CSS class(es) for the icon that can be displayed next to the [InterfaceElement.DisplayText](https://easyaf.nimbleapps.cloud/blazoressentials/api-reference/CloudNimble/BlazorEssentials/InterfaceElement.md#displaytext). |
| `category` | `string` | A string representing the parent category for this [NavigationItem](https://easyaf.nimbleapps.cloud/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem.md). Can be useful for grouping |
| [NavigationItem](https://easyaf.nimbleapps.cloud/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem.md)NavigationItems\</see> into caregories for display. | | |
| `isVisible` | `bool` | Specifies whether or not this [NavigationItem](https://easyaf.nimbleapps.cloud/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem.md) is visible on the NavBar. |
| `children` | `System.Collections.Generic.List<CloudNimble.BlazorEssentials.Navigation.NavigationItem>` | A [List\`1](https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1) containing nodes to render underneath this one. |

### &#x20;.ctor

#### Syntax

```csharp theme={"dark"}
public NavigationItem(string text, string icon, string url, string category, bool isVisible, string pageTitle, string pageIcon)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `text` | `string` | A string representing the text that will be displayed in the NavBar. |
| `icon` | `string` | A string representing the CSS class(es) for the icon that can be displayed next to the [InterfaceElement.DisplayText](https://easyaf.nimbleapps.cloud/blazoressentials/api-reference/CloudNimble/BlazorEssentials/InterfaceElement.md#displaytext). |
| `url` | `string` | A string corresponding to the route for this [NavigationItem](https://easyaf.nimbleapps.cloud/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem.md). |
| `category` | `string` | A string representing the parent category for this [NavigationItem](https://easyaf.nimbleapps.cloud/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem.md). Can be useful for grouping |
| [NavigationItem](https://easyaf.nimbleapps.cloud/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem.md)NavigationItems\</see> into caregories for display. | | |
| `isVisible` | `bool` | Specifies whether or not this [NavigationItem](https://easyaf.nimbleapps.cloud/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem.md) is visible on the NavBar. |
| `pageTitle` | `string` | A string representing the text that can be displayed as a page header. |
| `pageIcon` | `string` | A string representing the CSS class(es) for the icon that can be displayed next to the [NavigationItem.PageTitle](https://easyaf.nimbleapps.cloud/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem.md#pagetitle) in a page header. |

### &#x20;.ctor

#### Syntax

```csharp theme={"dark"}
public NavigationItem(string text, string icon, string url, string category, bool isVisible, string pageTitle, string pageIcon, string roles, bool allowAnonymous = false)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `text` | `string` | A string representing the text that will be displayed in the NavBar. |
| `icon` | `string` | A string representing the CSS class(es) for the icon that can be displayed next to the [InterfaceElement.DisplayText](https://easyaf.nimbleapps.cloud/blazoressentials/api-reference/CloudNimble/BlazorEssentials/InterfaceElement.md#displaytext). |
| `url` | `string` | A string corresponding to the route for this [NavigationItem](https://easyaf.nimbleapps.cloud/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem.md). |
| `category` | `string` | A string representing the parent category for this [NavigationItem](https://easyaf.nimbleapps.cloud/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem.md). Can be useful for grouping |
| [NavigationItem](https://easyaf.nimbleapps.cloud/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem.md)NavigationItems\</see> into caregories for display. | | |
| `isVisible` | `bool` | Specifies whether or not this [NavigationItem](https://easyaf.nimbleapps.cloud/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem.md) is visible on the NavBar. |
| `pageTitle` | `string` | A string representing the text that can be displayed as a page header. |
| `pageIcon` | `string` | A string representing the CSS class(es) for the icon that can be displayed next to the [NavigationItem.PageTitle](https://easyaf.nimbleapps.cloud/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem.md#pagetitle) in a page header. |
| `roles` | `string` | - |
| `allowAnonymous` | `bool` | - |

### &#x20;.ctor Inherited

> [!NOTE]
>
> Inherited from `CloudNimble.BlazorEssentials.InterfaceElement`

#### Syntax

```csharp theme={"dark"}
public InterfaceElement()
```

### &#x20;.ctor Inherited

> [!NOTE]
>
> Inherited from `CloudNimble.BlazorEssentials.InterfaceElement`

#### Syntax

```csharp theme={"dark"}
public InterfaceElement(string displayText, string iconClass, string cssClass = null)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `displayText` | `string` | - |
| `iconClass` | `string` | - |
| `cssClass` | `string` | - |

### &#x20;.ctor Inherited

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={"dark"}
public Object()
```

## Properties

### &#x20;AccessibilityText

Test to be used for screen readers when this item is rendered.

#### Syntax

```csharp theme={"dark"}
public string AccessibilityText { get; set; }
```

#### Property Value

Type: `string`

### &#x20;AllowAnonymous

A [Boolean](https://learn.microsoft.com/dotnet/api/system.boolean) specifying whether or not this [NavigationItem](https://easyaf.nimbleapps.cloud/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem.md) is visible when a user is not logged in.

#### Syntax

```csharp theme={"dark"}
public bool AllowAnonymous { get; }
```

#### Property Value

Type: `bool`

### &#x20;Category

A string representing the parent category for this [NavigationItem](https://easyaf.nimbleapps.cloud/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem.md). Can be left blank, but useful for grouping
[NavigationItem](https://easyaf.nimbleapps.cloud/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem.md)NavigationItems\</see> into caregories for display.

#### Syntax

```csharp theme={"dark"}
public string Category { get; set; }
```

#### Property Value

Type: `string`

### &#x20;Children

#### Syntax

```csharp theme={"dark"}
public System.Collections.Generic.List<CloudNimble.BlazorEssentials.Navigation.NavigationItem> Children { get; set; }
```

#### Property Value

Type: `System.Collections.Generic.List<CloudNimble.BlazorEssentials.Navigation.NavigationItem>`

### &#x20;CssClass Inherited

> [!NOTE]
>
> Inherited from `CloudNimble.BlazorEssentials.InterfaceElement`

A string representing the CSS classes that will be applied to the element.

#### Syntax

```csharp theme={"dark"}
public string CssClass { get; set; }
```

#### Property Value

Type: `string`

### &#x20;DisplayText Inherited

> [!NOTE]
>
> Inherited from `CloudNimble.BlazorEssentials.InterfaceElement`

A string representing the text that will be displayed inside the element.

#### Syntax

```csharp theme={"dark"}
public string DisplayText { get; set; }
```

#### Property Value

Type: `string`

### &#x20;IconClass Inherited

> [!NOTE]
>
> Inherited from `CloudNimble.BlazorEssentials.InterfaceElement`

A string representing the CSS class for the icon that will be rendered immediately before the [InterfaceElement.DisplayText](https://easyaf.nimbleapps.cloud/blazoressentials/api-reference/CloudNimble/BlazorEssentials/InterfaceElement.md#displaytext).

#### Syntax

```csharp theme={"dark"}
public string IconClass { get; set; }
```

#### Property Value

Type: `string`

### &#x20;IsVisible

Specifies whether or not this [NavigationItem](https://easyaf.nimbleapps.cloud/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem.md) is visible on the NavBar. Defaults to True.

#### Syntax

```csharp theme={"dark"}
public bool IsVisible { get; set; }
```

#### Property Value

Type: `bool`

### &#x20;PageIcon

A string representing the CSS class(es) for the icon that can be displayed next to the [NavigationItem.PageTitle](https://easyaf.nimbleapps.cloud/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem.md#pagetitle) in a page header.

#### Syntax

```csharp theme={"dark"}
public string PageIcon { get; set; }
```

#### Property Value

Type: `string`

### &#x20;PageTitle

A string representing the text that can be displayed as a page header.

#### Syntax

```csharp theme={"dark"}
public string PageTitle { get; set; }
```

#### Property Value

Type: `string`

### &#x20;Parameters

Allows you to set parameters specific to the page that you do NOT want to pass through the Routing system.

#### Syntax

```csharp theme={"dark"}
public dynamic Parameters { get; set; }
```

#### Property Value

Type: `dynamic`

#### Remarks

Accessible through [AppStateBase.CurrentNavItem](https://easyaf.nimbleapps.cloud/blazoressentials/api-reference/CloudNimble/BlazorEssentials/AppStateBase.md#currentnavitem).

### &#x20;Roles

A [HashSet\`1](https://learn.microsoft.com/dotnet/api/system.collections.generic.hashset-1) of roles that this NavigationItem is visible to.

#### Syntax

```csharp theme={"dark"}
public System.Collections.Generic.HashSet<string> Roles { get; private set; }
```

#### Property Value

Type: `System.Collections.Generic.HashSet<string>`

### &#x20;Url

A string corresponding to the route for this [NavigationItem](https://easyaf.nimbleapps.cloud/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem.md).

#### Syntax

```csharp theme={"dark"}
public string Url { get; set; }
```

#### Property Value

Type: `string`

## Methods

### &#x20;Equals Inherited Virtual

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={"dark"}
public virtual bool Equals(object obj)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `obj` | `object?` | - |

#### Returns

Type: `bool`

### &#x20;Equals Inherited

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={"dark"}
public static bool Equals(object objA, object objB)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `objA` | `object?` | - |
| `objB` | `object?` | - |

#### Returns

Type: `bool`

### &#x20;GetHashCode Inherited Virtual

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={"dark"}
public virtual int GetHashCode()
```

#### Returns

Type: `int`

### &#x20;GetType Inherited

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={"dark"}
public System.Type GetType()
```

#### Returns

Type: `System.Type`

### &#x20;IsVisibleToUser

Returns a boolean indicating whether or not the NavItem is available to any of the Roles the *claimsPrincipal* is in.

#### Syntax

```csharp theme={"dark"}
public bool IsVisibleToUser(System.Security.Claims.ClaimsPrincipal claimsPrincipal)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `claimsPrincipal` | `System.Security.Claims.ClaimsPrincipal` | - |

#### Returns

Type: `bool`

### &#x20;MemberwiseClone Inherited

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={"dark"}
protected internal object MemberwiseClone()
```

#### Returns

Type: `object`

### &#x20;ReferenceEquals Inherited

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={"dark"}
public static bool ReferenceEquals(object objA, object objB)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `objA` | `object?` | - |
| `objB` | `object?` | - |

#### Returns

Type: `bool`

### &#x20;ToString Inherited Virtual

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={"dark"}
public virtual string ToString()
```

#### Returns

Type: `string?`


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.