# Clickable

> Constructor.

## Definition

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

## Clickable(Action, long, long)

Constructor.

```csharp
public Clickable(Action handler, long delay, long interval)
```

### Parameters

**** (\[Action]\(https\://learn.microsoft.com/dotnet/api/system.action)): **** (\[long]\(https\://learn.microsoft.com/dotnet/api/system.int64)): Determines when the event begins. Value is defined in milliseconds. Applies if delay is greater than `0`.**** (\[long]\(https\://learn.microsoft.com/dotnet/api/system.int64)): Determines the time delta between event repetition. Value is defined in milliseconds. Applies if interval is greater than `0`.

### Examples

```csharp
using UnityEditor;
using UnityEngine;
using UnityEngine.UIElements;

public class ClickableEditorWindow : EditorWindow
{
    [MenuItem("Window/UI Toolkit/Clickable Example")]
    public static void ShowWindow()
    {
        var window = GetWindow<ClickableEditorWindow>();
        window.titleContent = new GUIContent("Clickable Example");
    } 

    public void CreateGUI()
    {

        var clickableElement = new VisualElement
        {
            style =
            {
                width = 200,
                height = 40,
                backgroundColor = new Color(0.2f, 0.6f, 0.8f, 1),
                justifyContent = Justify.Center,
                alignItems = Align.Center,
            }
        };
        clickableElement.Add(new Label("Click Me"));

        clickableElement.AddManipulator(new Clickable(() =>
        {
            Debug.Log("Element clicked!");
        }));

        rootVisualElement.Add(clickableElement);
    }
}
```

## Clickable(Action\<EventBase>)

Constructor.

```csharp
public Clickable(Action<EventBase> handler)
```

### Parameters

**** (\[Action\<EventBase>]\(https\://learn.microsoft.com/dotnet/api/system.action)):&#x20;

### Examples

```csharp
using UnityEditor;
using UnityEngine;
using UnityEngine.UIElements;

public class ClickableEditorWindow : EditorWindow
{
    [MenuItem("Window/UI Toolkit/Clickable Example")]
    public static void ShowWindow()
    {
        var window = GetWindow<ClickableEditorWindow>();
        window.titleContent = new GUIContent("Clickable Example");
    } 

    public void CreateGUI()
    {

        var clickableElement = new VisualElement
        {
            style =
            {
                width = 200,
                height = 40,
                backgroundColor = new Color(0.2f, 0.6f, 0.8f, 1),
                justifyContent = Justify.Center,
                alignItems = Align.Center,
            }
        };
        clickableElement.Add(new Label("Click Me"));

        clickableElement.AddManipulator(new Clickable(() =>
        {
            Debug.Log("Element clicked!");
        }));

        rootVisualElement.Add(clickableElement);
    }
}
```

## Clickable(Action)

Constructor.

```csharp
public Clickable(Action handler)
```

### Parameters

**** (\[Action]\(https\://learn.microsoft.com/dotnet/api/system.action)):&#x20;

### Examples

```csharp
using UnityEditor;
using UnityEngine;
using UnityEngine.UIElements;

public class ClickableEditorWindow : EditorWindow
{
    [MenuItem("Window/UI Toolkit/Clickable Example")]
    public static void ShowWindow()
    {
        var window = GetWindow<ClickableEditorWindow>();
        window.titleContent = new GUIContent("Clickable Example");
    } 

    public void CreateGUI()
    {

        var clickableElement = new VisualElement
        {
            style =
            {
                width = 200,
                height = 40,
                backgroundColor = new Color(0.2f, 0.6f, 0.8f, 1),
                justifyContent = Justify.Center,
                alignItems = Align.Center,
            }
        };
        clickableElement.Add(new Label("Click Me"));

        clickableElement.AddManipulator(new Clickable(() =>
        {
            Debug.Log("Element clicked!");
        }));

        rootVisualElement.Add(clickableElement);
    }
}
```
