> ## Documentation Index
> Fetch the complete documentation index at: https://easyaf.dev/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

### <Icon icon="hammer" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> .ctor

#### Syntax

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

### <Icon icon="hammer" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> .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](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/InterfaceElement#displaytext). |
| `url`  | `string` | A string corresponding to the route for this [NavigationItem](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem).                                                            |

### <Icon icon="hammer" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> .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](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/InterfaceElement#displaytext). |
| `url`                                                                                                                                                       | `string` | A string corresponding to the route for this [NavigationItem](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem).                                                            |
| `category`                                                                                                                                                  | `string` | A string representing the parent category for this [NavigationItem](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem). Can be useful for grouping                           |
| [NavigationItem](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem)NavigationItems\</see> into caregories for display. |          |                                                                                                                                                                                                                   |

### <Icon icon="hammer" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> .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](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/InterfaceElement#displaytext). |
| `url`                                                                                                                                                       | `string` | A string corresponding to the route for this [NavigationItem](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem).                                                            |
| `category`                                                                                                                                                  | `string` | A string representing the parent category for this [NavigationItem](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem). Can be useful for grouping                           |
| [NavigationItem](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem)NavigationItems\</see> into caregories for display. |          |                                                                                                                                                                                                                   |
| `isVisible`                                                                                                                                                 | `bool`   | Specifies whether or not this [NavigationItem](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem) is visible on the NavBar.                                                  |

### <Icon icon="hammer" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> .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](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/InterfaceElement#displaytext). |
| `category`                                                                                                                                                  | `string`                                                                                  | A string representing the parent category for this [NavigationItem](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem). Can be useful for grouping                           |
| [NavigationItem](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem)NavigationItems\</see> into caregories for display. |                                                                                           |                                                                                                                                                                                                                   |
| `isVisible`                                                                                                                                                 | `bool`                                                                                    | Specifies whether or not this [NavigationItem](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem) 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.                                                                             |

### <Icon icon="hammer" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> .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](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/InterfaceElement#displaytext).                     |
| `url`                                                                                                                                                       | `string` | A string corresponding to the route for this [NavigationItem](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem).                                                                                |
| `category`                                                                                                                                                  | `string` | A string representing the parent category for this [NavigationItem](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem). Can be useful for grouping                                               |
| [NavigationItem](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem)NavigationItems\</see> into caregories for display. |          |                                                                                                                                                                                                                                       |
| `isVisible`                                                                                                                                                 | `bool`   | Specifies whether or not this [NavigationItem](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem) 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](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem#pagetitle) in a page header. |

### <Icon icon="hammer" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> .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](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/InterfaceElement#displaytext).                     |
| `url`                                                                                                                                                       | `string` | A string corresponding to the route for this [NavigationItem](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem).                                                                                |
| `category`                                                                                                                                                  | `string` | A string representing the parent category for this [NavigationItem](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem). Can be useful for grouping                                               |
| [NavigationItem](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem)NavigationItems\</see> into caregories for display. |          |                                                                                                                                                                                                                                       |
| `isVisible`                                                                                                                                                 | `bool`   | Specifies whether or not this [NavigationItem](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem) 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](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem#pagetitle) in a page header. |
| `roles`                                                                                                                                                     | `string` | -                                                                                                                                                                                                                                     |
| `allowAnonymous`                                                                                                                                            | `bool`   | -                                                                                                                                                                                                                                     |

### <Icon icon="hammer" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> .ctor <Badge color="gray">Inherited</Badge>

<Note>Inherited from `CloudNimble.BlazorEssentials.InterfaceElement`</Note>

#### Syntax

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

### <Icon icon="hammer" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> .ctor <Badge color="gray">Inherited</Badge>

<Note>Inherited from `CloudNimble.BlazorEssentials.InterfaceElement`</Note>

#### Syntax

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

#### Parameters

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

### <Icon icon="hammer" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> .ctor <Badge color="gray">Inherited</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

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

## Properties

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> 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`

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> AllowAnonymous

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

#### Syntax

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

#### Property Value

Type: `bool`

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> Category

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

#### Syntax

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

#### Property Value

Type: `string`

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> 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>`

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> CssClass <Badge color="gray">Inherited</Badge>

<Note>Inherited from `CloudNimble.BlazorEssentials.InterfaceElement`</Note>

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`

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> DisplayText <Badge color="gray">Inherited</Badge>

<Note>Inherited from `CloudNimble.BlazorEssentials.InterfaceElement`</Note>

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`

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> IconClass <Badge color="gray">Inherited</Badge>

<Note>Inherited from `CloudNimble.BlazorEssentials.InterfaceElement`</Note>

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

#### Syntax

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

#### Property Value

Type: `string`

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> IsVisible

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

#### Syntax

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

#### Property Value

Type: `bool`

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> PageIcon

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

#### Syntax

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

#### Property Value

Type: `string`

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> 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`

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> 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](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/AppStateBase#currentnavitem).

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> 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>`

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> Url

A string corresponding to the route for this [NavigationItem](/blazoressentials/api-reference/CloudNimble/BlazorEssentials/Navigation/NavigationItem).

#### Syntax

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

#### Property Value

Type: `string`

## Methods

### <Icon icon="code-fork" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> Equals <Badge color="gray">Inherited</Badge> <Badge color="orange">Virtual</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

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

#### Parameters

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

#### Returns

Type: `bool`

### <Icon icon="thumbtack" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> Equals <Badge color="gray">Inherited</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

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

#### Parameters

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

#### Returns

Type: `bool`

### <Icon icon="code-fork" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> GetHashCode <Badge color="gray">Inherited</Badge> <Badge color="orange">Virtual</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

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

#### Returns

Type: `int`

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> GetType <Badge color="gray">Inherited</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

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

#### Returns

Type: `System.Type`

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> 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`

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> MemberwiseClone <Badge color="gray">Inherited</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

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

#### Returns

Type: `object`

### <Icon icon="thumbtack" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> ReferenceEquals <Badge color="gray">Inherited</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

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

#### Parameters

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

#### Returns

Type: `bool`

### <Icon icon="code-fork" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> ToString <Badge color="gray">Inherited</Badge> <Badge color="orange">Virtual</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

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

#### Returns

Type: `string?`
