> ## Documentation Index
> Fetch the complete documentation index at: https://luau.limerence.biz/llms.txt
> Use this file to discover all available pages before exploring further.

# ElementHandle

> Base handle for every widget created with Add*.

Every `Add*` call returns a handle. That's how you interact with the control after creating it. Call methods with `:` syntax (`handle:GetValue()`).

Everything here works on every control. The per-widget pages only document extras.

## Value

Most controls have one main value (a `boolean` on [Toggle](/ui/classes/toggle), a `number` on [Slider](/ui/classes/slider), …). Use `GetValue`, `SetValue`, and `OnChange` for that. [Button](/ui/classes/button) and a few others don't, so use their own callbacks instead.

***

## GetValue

```luau theme={null}
handle:GetValue(): any
```

Read the control's current value.

***

## SetValue

```luau theme={null}
handle:SetValue(value: any): ()
```

Change the control's value. Single argument only.

<ParamField path="value" type="any" required>
  Must match the widget's value type.
</ParamField>

***

## OnChange

```luau theme={null}
handle:OnChange(callback: (value: any) -> ()): () -> ()
```

Run `cb(newValue)` every time the value changes: user edits, `SetValue`, `SetState`.

<ResponseField name="returns" type="() -> ()">
  A function you call to stop listening.
</ResponseField>

```luau theme={null}
local stop = handle:OnChange(function(v) print(v) end)
stop() -- no longer listening
```

***

## GetText / SetText

```luau theme={null}
handle:GetText(): string
handle:SetText(text: string): ()
```

Read or change the control's label.

***

## Get / Set

```luau theme={null}
handle:Get(field: string): any
handle:Set(field: string, value: any): ()
```

Read or change other properties on the control (e.g. `"formattedValue"` on a [Slider](/ui/classes/slider)).

***

## Watch

```luau theme={null}
handle:Watch(field: string, callback: (value: any) -> ()): () -> ()
```

Listen for changes to a specific property. Returns an unsubscribe function.

***

## Has

```luau theme={null}
handle:Has(field: string): boolean
```

Check whether the control has a given property.

***

## SetVisible / IsVisible / OnVisibleChange

```luau theme={null}
handle:SetVisible(visible: boolean): ElementHandle
handle:IsVisible(): boolean
handle:OnVisibleChange(callback: (visible: boolean) -> ()): () -> ()
```

Show or hide the row. `SetVisible` returns `self` for chaining.

***

## SetTip

```luau theme={null}
handle:SetTip(tip: string | { title: string?, body: string? }? | nil): ElementHandle
```

Hover tooltip. Pass `nil` to remove.

<ParamField path="tip" type="string | table | nil">
  A string, or `{ title?, body? }` for a two-part tooltip.
</ParamField>

***

## OverrideValue

```luau theme={null}
handle:OverrideValue(value: any, priority: number?): OverrideHandle
```

Force the control's value without changing what the UI shows. See [Overrides](/overrides/overview).

<ParamField path="priority" type="number" default="0">
  Highest priority wins when multiple scripts override the same control.
</ParamField>

<ResponseField name="returns" type="OverrideHandle">
  Released automatically on script unload.
</ResponseField>

***

## IsOverridden

```luau theme={null}
handle:IsOverridden(): boolean
```

True while any override is active on this control.

***

## Destroy

```luau theme={null}
handle:Destroy(): ()
```

Remove the control from the UI.

***

## Exists

```luau theme={null}
handle:Exists(): boolean
```

`true` if the control still exists in the menu.

***

## Other methods

If you call a method that isn't listed here, it's passed through to the control itself. See the per-widget pages.
