# AddItem

> Adds an item to this menu using a default VisualElement.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine.UIElements](/engine/6000.0/script-reference/unityengine/uielements.md)
* **Assembly:** UnityEngine.UIElementsModule

## AddItem(string, bool, Action)

Adds an item to this menu using a default VisualElement.

```csharp
public void AddItem(string itemName, bool isChecked, Action action)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The text to display to the user.**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): Indicates whether a checkmark next to the item is displayed.**** (\[Action]\(https\://learn.microsoft.com/dotnet/api/system.action)): The callback to invoke when the item is selected by the user.

## AddItem(string, bool, Action\<Object>, Object)

Adds an item to this menu using a default VisualElement.

```csharp
public void AddItem(string itemName, bool isChecked, Action<object> action, object data)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The text to display to the user.**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): Indicates whether a checkmark next to the item is displayed.**** (\[Action\<Object>]\(https\://learn.microsoft.com/dotnet/api/system.action)): The callback to invoke when the item is selected by the user.**** (\[Object]\(https\://learn.microsoft.com/dotnet/api/system.object)): The object to pass to the callback as a parameter.

### Remarks

This overload of the method accepts an arbitrary object that's passed as a parameter to your callback.
