# MainToolbarCustomElement(Func<VisualElement>)

> Specify the `VisualElement` content of a main toolbar custom element.

## Definition

* **Type:** Constructor
* **Namespace:** [UnityEditor.Toolbars](/engine/6000.7/script-reference/unityeditor/toolbars.md)
* **Assembly:** UnityEditor

```csharp
public MainToolbarCustomElement(Func<VisualElement> createElement)
```

### Parameters

**** (\[Func\<VisualElement>]\(https\://learn.microsoft.com/dotnet/api/system.func-1)): A function that creates the `VisualElement` to display in the main toolbar.
