# Items

You can instantiate the ContextMenu items by initializing them as [`MenuItem`](https://www.telerik.com/kendo-angular-ui-develop/components/menus/api/menuitem) components and use their corresponding properties.

ContextMenu children are represented by nesting the `MenuItem` components.

The `MenuItem` component provides configuration options for:

<Row>
  <Column count={[24,24,8]} style={{marginBottom: "1rem"}}>
    <Component className="tile" href="#showing-text">
      <ComponentTitle>Setting Item Text</ComponentTitle>
      <ComponentDescription style={{padding: "0 10px 10px 10px"}}>Define the textual content displayed for each menu item.</ComponentDescription>
    </Component>
  </Column>
  <Column count={[24,24,8]} style={{marginBottom: "1rem"}}>
    <Component className="tile" href="#rendering-urls">
      <ComponentTitle>Setting a URL</ComponentTitle>
      <ComponentDescription style={{padding: "0 10px 10px 10px"}}>Configure menu items as links with URL navigation.</ComponentDescription>
    </Component>
  </Column>
  <Column count={[24,24,8]} style={{marginBottom: "1rem"}}>
    <Component className="tile" href="#displaying-icons">
      <ComponentTitle>Setting an Icon</ComponentTitle>
      <ComponentDescription style={{padding: "0 10px 10px 10px"}}>Add SVG or font icons to enhance menu item visual presentation.</ComponentDescription>
    </Component>
  </Column>
  <Column count={[24,24,8]} style={{marginBottom: "1rem"}}>
    <Component className="tile" href="#adding-styles-and-classes">
      <ComponentTitle>Setting Styles and Classes</ComponentTitle>
      <ComponentDescription style={{padding: "0 10px 10px 10px"}}>Apply custom CSS styles and classes to menu items.</ComponentDescription>
    </Component>
  </Column>
  <Column count={[24,24,8]} style={{marginBottom: "1rem"}}>
    <Component className="tile" href="#disabling-items">
      <ComponentTitle>Setting a Disabled State</ComponentTitle>
      <ComponentDescription style={{padding: "0 10px 10px 10px"}}>Prevent user interaction with specific menu items.</ComponentDescription>
    </Component>
  </Column>
  <Column count={[24,24,8]} style={{marginBottom: "1rem"}}>
    <Component className="tile" href="#showing-separator-items">
      <ComponentTitle>Creating Items as Separators</ComponentTitle>
      <ComponentDescription style={{padding: "0 10px 10px 10px"}}>Add visual separators between groups of menu items.</ComponentDescription>
    </Component>
  </Column>
  <Column count={[24,24,8]} style={{marginBottom: "1rem"}}>
    <Component className="tile" href="#using-templates">
      <ComponentTitle>Customizing Content by Using Templates</ComponentTitle>
      <ComponentDescription style={{padding: "0 10px 10px 10px"}}>Use Angular templates to create custom menu item layouts and content.</ComponentDescription>
    </Component>
  </Column>
</Row>

## Showing Text

You can set the text of the ContextMenu items by using the [`text`](https://www.telerik.com/kendo-angular-ui-develop/components/menus/api/menuitemcomponent#text) input of the `MenuItem` component.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/menus/context-menu/items/text/source.txt)

## Rendering URLs

You can set the URL of the items by using the [`url`](https://www.telerik.com/kendo-angular-ui-develop/components/menus/api/menuitemcomponent#url) input of the `MenuItem` component. The URL will be rendered as a `href` attribute on the item link.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/menus/context-menu/items/url/source.txt)

## Displaying Icons

Depending on the configuration of the project, you can enhance the content of the ContextMenu by displaying any of the following icon types:

* [SVG icons](https://www.telerik.com/kendo-angular-ui-develop/components/menus/contextmenu/items#displaying-svg-icons)
* [Font icons](https://www.telerik.com/kendo-angular-ui-develop/components/menus/contextmenu/items#displaying-font-icons)

> As of R2 2023 (`v13.0.0`) the default icon type in the Kendo UI for Angular components and Kendo UI themes is changed from `font` to `svg`.
> Set the `svgIcon` property, or [Continue Using Font Icons](https://www.telerik.com/kendo-angular-ui-develop/components/styling/migrating-font-svg#continue-using-font-icons).

### Displaying SVG Icons

To display an SVG icon in the items of the ContextMenu, select the desired one from the [list of SVG icons supported by Kendo UI for Angular](https://www.telerik.com/kendo-angular-ui-develop/components/icons/svgicon/svgicon-list), and set the [`svgIcon`](https://www.telerik.com/kendo-angular-ui-develop/components/menus/api/menuitemcomponent#svgicon) property to the necessary icon name.

```html
<kendo-menu-item [svgIcon]="svgFolder"></kendo-menu-item>
```

The following example demonstrates how to set the `svgIcon` property of the `MenuItem` component.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/menus/context-menu/items/icons/svg/source.txt)

### Displaying Font Icons

To display a `font` icon inside the items of the ContextMenu:

1. Use the [`ICON_SETTINGS`](https://www.telerik.com/kendo-angular-ui-develop/components/icons/api/icon_settings) token of the Icons package and set the icon type to `font`. For more information, go to the topic about [`icon settings`](https://www.telerik.com/kendo-angular-ui-develop/components/icons/icon-settings).
2. Set the [`icon`](https://www.telerik.com/kendo-angular-ui-develop/components/menus/api/menuitemcomponent#icon) property to the necessary icon. For more details, go to the [list of font icons supported by Kendo UI for Angular](https://www.telerik.com/kendo-angular-ui-develop/components/icons/icon/icon-list).

```html
<kendo-menu-item icon="folder"></kendo-menu-item>
```

The following example demonstrates how to set the `icon` property of the `MenuItem` component.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/menus/context-menu/items/icons/regular/source.txt)

## Adding Styles and Classes

You can set styles and classes to the items by using the [`cssStyle`](https://www.telerik.com/kendo-angular-ui-develop/components/menus/api/menuitemcomponent#cssstyle) and [`cssClass`](https://www.telerik.com/kendo-angular-ui-develop/components/menus/api/menuitemcomponent#cssclass) inputs of the `MenuItem` component. `cssStyle` and `cssClass` support the same values as [`ngStyle`](https://angular.dev/api/common/NgStyle#) and [`ngClass`](https://angular.dev/api/common/NgClass).

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/menus/context-menu/items/stylesclasses/source.txt)

## Disabling Items

You can specify that a ContextMenu item is disabled by using the [`disabled`](https://www.telerik.com/kendo-angular-ui-develop/components/menus/api/menuitemcomponent#disabled) input of the `MenuItem` component.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/menus/context-menu/items/disabled/source.txt)

## Showing Separator Items

You can specify that an item will be rendered as separating other items by using the [`separator`](https://www.telerik.com/kendo-angular-ui-develop/components/menus/api/menuitemcomponent#separator) input of the `MenuItem` component.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/menus/context-menu/items/separator/source.txt)

## Using Templates

To define a template for an item, nest an `<ng-template>` tag with the [`kendoMenuItemTemplate`](https://www.telerik.com/kendo-angular-ui-develop/components/menus/api/itemtemplatedirective) directive inside a `MenuItem` component.

To define a template for an item link, nest an `<ng-template>` tag with the [`kendoMenuItemLinkTemplate`](https://www.telerik.com/kendo-angular-ui-develop/components/menus/api/itemlinktemplatedirective) directive inside a `MenuItem` component.

To define a template for the item content in place of the children, nest an `<ng-template>` tag with a [`kendoMenuItemContentTemplate`](https://www.telerik.com/kendo-angular-ui-develop/components/menus/api/itemcontenttemplatedirective) directive inside that item.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/menus/context-menu/items/templates/source.txt)

## Suggested Links

* [API Reference of the ContextMenu](https://www.telerik.com/kendo-angular-ui-develop/components/menus/api)
