# ui

## Example available!

{% content-ref url="../../useful-information/script-examples/ui" %}
[ui](https://docs-csgo.neverlose.cc/useful-information/script-examples/ui)
{% endcontent-ref %}

## Functions:

### get\_alpha

`ui.get_alpha():` <mark style="color:purple;">`number`</mark>

Returns the menu opacity as a unit interval (value in the range \[0, 1]).

### get\_size

`ui.get_size():` <mark style="color:purple;">`vector`</mark>

Returns the current menu size.

### get\_position

`ui.get_position():` <mark style="color:purple;">`vector`</mark>

Returns the current menu position.

### get\_mouse\_position

`ui.get_mouse_position():` <mark style="color:purple;">`vector`</mark>

Returns the current mouse position.

### get\_binds

`ui.get_binds():` <mark style="color:purple;">`table`</mark>

Returns a table of pointers to hotkeys.

#### struct <mark style="color:purple;">`Hotkey`</mark>

<table><thead><tr><th width="150">Name</th><th width="162.52330706200414">Type</th><th width="410.3276962436035">Description</th></tr></thead><tbody><tr><td><strong>name</strong></td><td><strong><code>string</code></strong></td><td>Hotkey name</td></tr><tr><td><strong>mode</strong></td><td><strong><code>number</code></strong></td><td>Hotkey mode (<mark style="color:purple;"><code>1</code></mark>: Hold, <mark style="color:purple;"><code>2</code></mark>: Toggle)</td></tr><tr><td><strong>value</strong></td><td><strong><code>any</code></strong></td><td>Hotkey value</td></tr><tr><td><strong>active</strong></td><td><strong><code>boolean</code></strong></td><td>Hotkey state</td></tr><tr><td><strong>reference</strong></td><td><strong><code>MenuItem</code></strong></td><td>Pointer to the menu item</td></tr></tbody></table>

### get\_style

`ui.get_style([ name: string ]):` <mark style="color:purple;">`color`</mark> / <mark style="color:purple;">`table`</mark>

Returns the color of the Style Option. Pass `nil` to return a table with the style options.

### get\_icon

`ui.get_icon(name: string):` <mark style="color:purple;">`string`</mark>

Returns the unicode converted string corresponding the fontawesome icon.

### create

{% tabs %}
{% tab title="Group" %}
`ui.create(group: string):` <mark style="color:purple;">`MenuGroup`</mark>

<table><thead><tr><th width="150">Name</th><th width="150">Type</th><th>Description</th></tr></thead><tbody><tr><td><strong>group</strong></td><td><strong><code>string</code></strong></td><td>Group name</td></tr></tbody></table>

\
Creates and returns a menu group object.

<div align="left"><img src="https://3594665820-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F37PG3extaxoGL9yvcP52%2Fuploads%2FkkzsiSorcLwkRYPEdlA3%2Fimage.png?alt=media&#x26;token=e0b7caf2-6985-4fff-ab8c-a678a708197a" alt=""></div>
{% endtab %}

{% tab title="Tab" %}
`ui.create(tab: string, group: string[, column: number]):` <mark style="color:purple;">`MenuGroup`</mark>

<table><thead><tr><th width="150">Name</th><th width="150">Type</th><th>Description</th></tr></thead><tbody><tr><td><strong>tab</strong></td><td><strong><code>string</code></strong></td><td>Tab name</td></tr><tr><td><strong>group</strong></td><td><strong><code>string</code></strong></td><td>Group name</td></tr><tr><td><strong>column</strong></td><td><strong><code>number</code></strong></td><td>Optional. Column ID (<mark style="color:purple;"><code>1</code></mark>: Left <mark style="color:purple;"><code>2</code></mark>: Right or <code>nil</code> for automatic alignment.)</td></tr></tbody></table>

\
Creates and returns a menu group object.

<div align="left"><img src="https://3594665820-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F37PG3extaxoGL9yvcP52%2Fuploads%2Fg9W2zQVZ0LkY6Iep5xvl%2Fimage.png?alt=media&#x26;token=f79dabe5-ed02-4a6d-813a-80fb0080a218" alt=""></div>
{% endtab %}
{% endtabs %}

### find

{% tabs %}
{% tab title="Item example" %}
`ui.find(category: string, tab: string, group: string, item: string):` <mark style="color:purple;">`MenuItem`</mark>

<table><thead><tr><th width="199">Name</th><th width="162.52330706200414">Type</th><th width="410.3276962436035">Description</th></tr></thead><tbody><tr><td><strong>category</strong></td><td><strong><code>string</code></strong></td><td>Category name, e.g. "Aimbot" or "Visuals".</td></tr><tr><td><strong>tab</strong></td><td><strong><code>string</code></strong></td><td>Tab name that belongs to the category.</td></tr><tr><td><strong>group</strong></td><td><strong><code>string</code></strong></td><td>Name of group with the item.</td></tr><tr><td><strong>item</strong></td><td><strong><code>string</code></strong></td><td>The needed item.</td></tr></tbody></table>

Returns the <mark style="color:purple;">`MenuItem`</mark> object that corresponds to the specified path.

`ui.find(category: string, tab: string, sub_tab: string, group: string, item: string):` <mark style="color:purple;">`MenuItem`</mark>

<table><thead><tr><th width="199">Name</th><th width="162.52330706200414">Type</th><th width="410.3276962436035">Description</th></tr></thead><tbody><tr><td><strong>category</strong></td><td><strong><code>string</code></strong></td><td>Category name, e.g. "Aimbot" or "Visuals".</td></tr><tr><td><strong>tab</strong></td><td><strong><code>string</code></strong></td><td>Tab name that belongs to the category.</td></tr><tr><td><strong>sub_tab</strong></td><td><strong><code>string</code></strong></td><td>Sub-tab name.</td></tr><tr><td><strong>group</strong></td><td><strong><code>string</code></strong></td><td>Name of group with the item.</td></tr><tr><td><strong>item</strong></td><td><strong><code>string</code></strong></td><td>The needed item.</td></tr></tbody></table>

Returns the <mark style="color:purple;">`MenuItem`</mark> object that corresponds to the specified path.
{% endtab %}

{% tab title="Sub-item example" %}
`ui.find(category: string, tab: string, group: string, item: string, sub_item):` <mark style="color:purple;">`MenuItem`</mark>

<table><thead><tr><th width="199">Name</th><th width="162.52330706200414">Type</th><th width="410.3276962436035">Description</th></tr></thead><tbody><tr><td><strong>category</strong></td><td><strong><code>string</code></strong></td><td>Category name, e.g. "Aimbot" or "Visuals".</td></tr><tr><td><strong>tab</strong></td><td><strong><code>string</code></strong></td><td>Tab name that belongs to the category.</td></tr><tr><td><strong>group</strong></td><td><strong><code>string</code></strong></td><td>Name of group with the item.</td></tr><tr><td><strong>item</strong></td><td><strong><code>string</code></strong></td><td>The item with a group (gear) attached.</td></tr><tr><td><strong>sub_item</strong></td><td><strong><code>string</code></strong></td><td>The sub-item in the item group.</td></tr></tbody></table>

Returns the <mark style="color:purple;">`MenuItem`</mark> object that corresponds to the specified path.

`ui.find(category: string, tab: string, sub_tab: string, group: string, item: string, sub_item):` <mark style="color:purple;">`MenuItem`</mark>

<table><thead><tr><th width="199">Name</th><th width="162.52330706200414">Type</th><th width="410.3276962436035">Description</th></tr></thead><tbody><tr><td><strong>category</strong></td><td><strong><code>string</code></strong></td><td>Category name, e.g. "Aimbot" or "Visuals".</td></tr><tr><td><strong>tab</strong></td><td><strong><code>string</code></strong></td><td>Tab name that belongs to the category.</td></tr><tr><td><strong>sub_tab</strong></td><td><strong><code>string</code></strong></td><td>Sub-tab name.</td></tr><tr><td><strong>group</strong></td><td><strong><code>string</code></strong></td><td>Name of group with the item.</td></tr><tr><td><strong>item</strong></td><td><strong><code>string</code></strong></td><td>The item with a group (gear) attached.</td></tr><tr><td><strong>sub_item</strong></td><td><strong><code>string</code></strong></td><td>The sub-item in the item group.</td></tr></tbody></table>

Returns the <mark style="color:purple;">`MenuItem`</mark> object that corresponds to the specified path.
{% endtab %}

{% tab title="Group example" %}
`ui.find(category: string, tab: string, group: string):` <mark style="color:purple;">`MenuGroup`</mark>

<table><thead><tr><th width="199">Name</th><th width="162.52330706200414">Type</th><th width="410.3276962436035">Description</th></tr></thead><tbody><tr><td><strong>category</strong></td><td><strong><code>string</code></strong></td><td>Category name, e.g. "Aimbot" or "Visuals".</td></tr><tr><td><strong>tab</strong></td><td><strong><code>string</code></strong></td><td>Tab name that belongs to the category.</td></tr><tr><td><strong>group</strong></td><td><strong><code>string</code></strong></td><td>Name of the needed group.</td></tr></tbody></table>

Returns the <mark style="color:purple;">`MenuGroup`</mark> object that corresponds to the specified path.

`ui.find(category: string, tab: string, sub_tab_name: string, group: string):` <mark style="color:purple;">`MenuGroup`</mark>

<table><thead><tr><th width="199">Name</th><th width="162.52330706200414">Type</th><th width="410.3276962436035">Description</th></tr></thead><tbody><tr><td><strong>category</strong></td><td><strong><code>string</code></strong></td><td>Category name, e.g. "Aimbot" or "Visuals".</td></tr><tr><td><strong>tab</strong></td><td><strong><code>string</code></strong></td><td>Tab name that belongs to the category.</td></tr><tr><td><strong>sub_tab</strong></td><td><strong><code>string</code></strong></td><td>Sub-tab name.</td></tr><tr><td><strong>group</strong></td><td><strong><code>string</code></strong></td><td>Name of the needed group.</td></tr></tbody></table>
{% endtab %}

{% tab title="Global item example " %}
`ui.find(group_name: string, item_name: string):` <mark style="color:purple;">`MenuItem`</mark>

<table><thead><tr><th width="199">Name</th><th width="163">Type</th><th width="410.3276962436035">Description</th></tr></thead><tbody><tr><td><strong>group_name</strong></td><td><strong><code>string</code></strong></td><td>Global group name, e.g. "Settings".</td></tr><tr><td><strong>item_name</strong></td><td><strong><code>string</code></strong></td><td>Item name, e.g. "Dpi Scale".</td></tr></tbody></table>

Returns the <mark style="color:purple;">`MenuItem`</mark> object that corresponds to the specified path.
{% endtab %}

{% tab title="ESP Item Example" %}
`ui.find(category: string, tab: string, sub_tab: string, group: string, item_category: string, item: string):` <mark style="color:purple;">`ESPGroup`</mark>

<table><thead><tr><th width="199">Name</th><th width="162.52330706200414">Type</th><th width="410.3276962436035">Description</th></tr></thead><tbody><tr><td><strong>category</strong></td><td><strong><code>string</code></strong></td><td></td></tr><tr><td><strong>tab</strong></td><td><strong><code>string</code></strong></td><td></td></tr><tr><td><strong>sub_tab</strong></td><td><strong><code>string</code></strong></td><td></td></tr><tr><td><strong>group</strong></td><td><strong><code>string</code></strong></td><td></td></tr><tr><td><strong>item_category</strong></td><td><strong><code>string</code></strong></td><td></td></tr><tr><td><strong>item</strong></td><td><strong><code>string</code></strong></td><td></td></tr></tbody></table>

Returns the <mark style="color:purple;">`ESPGroup`</mark> object that corresponds to the specified path.
{% endtab %}
{% endtabs %}

This can return multiple items or `nil` on failure.

### sidebar

{% embed url="<https://fontawesome.com/v6/search>" %}

`ui.sidebar([name: string, icon_name: string]):` <mark style="color:purple;">`string`</mark>, <mark style="color:purple;">`string`</mark>

<table><thead><tr><th width="150">Name</th><th width="162.52330706200414">Type</th><th width="410.3276962436035">Description</th></tr></thead><tbody><tr><td><strong>name</strong></td><td><strong><code>string</code></strong></td><td>Optional. Sidebar tab name</td></tr><tr><td><strong>icon_name</strong></td><td><strong><code>string</code></strong></td><td>Optional. Icon name (Brand icons are currently not supported)</td></tr></tbody></table>

Gets or sets the sidebar tab name and an icon.

### localize

`ui.localize(lang: string, str: string[, localized: string]):` <mark style="color:purple;">`string`</mark> / <mark style="color:purple;">`nil`</mark>

<table><thead><tr><th width="150">Name</th><th width="162.52330706200414">Type</th><th width="410.3276962436035">Description</th></tr></thead><tbody><tr><td><strong>lang</strong></td><td><strong><code>string</code></strong></td><td>Language code.</td></tr><tr><td><strong>str</strong></td><td><strong><code>string</code></strong></td><td>String to localize or to get the localized string from.</td></tr><tr><td><strong>localized</strong></td><td><strong><code>string</code></strong></td><td>Optional. The localized variant.</td></tr></tbody></table>

Returns the localized string for the specified language code. If `localized` is present, the `str` will be localized accordingly.

## 🔗 <mark style="color:blue;">`MenuGroup`</mark>

### :switch

`group:switch(name: string[, init: boolean]):` <mark style="color:purple;">`MenuItem`</mark>

<table><thead><tr><th width="165.2187096468122">Name</th><th width="162.52330706200414">Type</th><th width="410.3276962436035">Description</th></tr></thead><tbody><tr><td><strong>name</strong></td><td><strong><code>string</code></strong></td><td>Item name</td></tr><tr><td><strong>init</strong></td><td><strong><code>boolean</code></strong></td><td>Default value</td></tr></tbody></table>

Creates and returns a menu item object, or throws an error on failure.

### :slider

`group:slider(name: string, min: number, max: number[, init: number, scale: number, tooltip: function]):` <mark style="color:purple;">`MenuItem`</mark>

<table><thead><tr><th width="166.60675064558396">Name</th><th width="162.52330706200414">Type</th><th width="410.3276962436035">Description</th></tr></thead><tbody><tr><td><strong>name</strong></td><td><strong><code>string</code></strong></td><td>Item name</td></tr><tr><td><strong>min</strong></td><td><strong><code>number</code></strong></td><td>Minimum allowed value</td></tr><tr><td><strong>max</strong></td><td><strong><code>number</code></strong></td><td>Maximum allowed value</td></tr><tr><td><strong>init</strong></td><td><strong><code>number</code></strong></td><td>Default value</td></tr><tr><td><strong>scale</strong></td><td><strong><code>number</code></strong></td><td>Display value multiplier. Can be used for decimal places.</td></tr><tr><td><strong>tooltip</strong></td><td><strong><code>string / function</code></strong></td><td>A string appends itself to the display value. A function allows you to access the raw display value and displays anything it returns.</td></tr></tbody></table>

Creates and returns a menu item object, or throws an error on failure.

### :combo

`group:combo(name: string, items: any[, ...]):` <mark style="color:purple;">`MenuItem`</mark>

<table><thead><tr><th width="150">Name</th><th width="162.52330706200414">Type</th><th width="410.3276962436035">Description</th></tr></thead><tbody><tr><td><strong>name</strong></td><td><strong><code>string</code></strong></td><td>Item name</td></tr><tr><td><strong>items</strong></td><td><strong><code>any</code></strong></td><td>One or more comma separated values that will be added to the combo. Alternatively, a table of strings that will be added</td></tr><tr><td><strong>...</strong></td><td></td><td></td></tr></tbody></table>

Creates and returns a menu item object, or throws an error on failure.

### :selectable

`group:selectable(name: string, items: any[, ...]):` <mark style="color:purple;">`MenuItem`</mark>

<table><thead><tr><th width="150">Name</th><th width="162.52330706200414">Type</th><th width="410.3276962436035">Description</th></tr></thead><tbody><tr><td><strong>name</strong></td><td><strong><code>string</code></strong></td><td>Item name</td></tr><tr><td><strong>items</strong></td><td><strong><code>any</code></strong></td><td>One or more comma separated values that will be added to the combo. Alternatively, a table of strings that will be added</td></tr><tr><td><strong>...</strong></td><td></td><td></td></tr></tbody></table>

Creates and returns a menu item object, or throws an error on failure.

### :color\_picker <a href="#render.line" id="render.line"></a>

{% tabs %}
{% tab title="Simple" %}
`group:color_picker(name: string[, color: color]):` <mark style="color:purple;">`MenuItem`</mark>

<table><thead><tr><th width="150">Name</th><th width="162.52330706200414">Type</th><th width="410.3276962436035">Description</th></tr></thead><tbody><tr><td><strong>name</strong></td><td><strong><code>string</code></strong></td><td>Item name</td></tr><tr><td><strong>color</strong></td><td><strong><code>color</code></strong></td><td>Optional. Initial color value</td></tr></tbody></table>
{% endtab %}

{% tab title="Multi-Color " %}
`group:color_picker(name: string, colors: table):` <mark style="color:purple;">`MenuItem`</mark>

<table><thead><tr><th width="150">Name</th><th width="162.52330706200414">Type</th><th width="410.3276962436035">Description</th></tr></thead><tbody><tr><td><strong>name</strong></td><td><strong><code>string</code></strong></td><td>Item name</td></tr><tr><td><strong>colors</strong></td><td><strong><code>table</code></strong></td><td>Table containing tables with a string index, and those tables should contain one or multiple color objects. Check UI examples.</td></tr></tbody></table>
{% endtab %}
{% endtabs %}

Creates and returns a menu item object, or throws an error on failure.

### :button

`group:button(name: string[, callback: function, alt_style: boolean]):` <mark style="color:purple;">`MenuItem`</mark>

<table><thead><tr><th width="150">Name</th><th width="162.52330706200414">Type</th><th width="410.3276962436035">Description</th></tr></thead><tbody><tr><td><strong>name</strong></td><td><strong><code>string</code></strong></td><td>Item name</td></tr><tr><td><strong>callback</strong></td><td><strong><code>function</code></strong></td><td>Optional. Function that will be called when the button is clicked</td></tr><tr><td><strong>alt_style</strong></td><td><strong><code>boolean</code></strong></td><td>Optional. Pass <mark style="color:purple;"><code>true</code></mark> to enable the alternative style for the specified button</td></tr></tbody></table>

Creates and returns a menu item object, or throws an error on failure.

### :hotkey

{% embed url="<https://docs.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes>" %}

`group:hotkey(name: string[, default_key: number):` <mark style="color:purple;">`MenuItem`</mark>

<table><thead><tr><th width="150">Name</th><th width="162.52330706200414">Type</th><th width="410.3276962436035">Description</th></tr></thead><tbody><tr><td><strong>name</strong></td><td><strong><code>string</code></strong></td><td>Item name</td></tr><tr><td><strong>default_key</strong></td><td><strong><code>number</code></strong></td><td>Optional. Default key</td></tr></tbody></table>

Creates and returns a menu item object, or throws an error on failure.

### :input

`group:input(name: string[, text: string]):` <mark style="color:purple;">`MenuItem`</mark>

<table><thead><tr><th width="150">Name</th><th width="162.52330706200414">Type</th><th width="410.3276962436035">Description</th></tr></thead><tbody><tr><td><strong>name</strong></td><td><strong><code>string</code></strong></td><td>Item name</td></tr><tr><td><strong>text</strong></td><td><strong><code>string</code></strong></td><td>Optional. Default value</td></tr></tbody></table>

Creates and returns a menu item object, or throws an error on failure.

### :list

`group:list(name: string, items: any[, ...]):` <mark style="color:purple;">`MenuItem`</mark>

<table><thead><tr><th width="150">Name</th><th width="162.52330706200414">Type</th><th width="410.3276962436035">Description</th></tr></thead><tbody><tr><td><strong>name</strong></td><td><strong><code>string</code></strong></td><td>Item name</td></tr><tr><td><strong>items</strong></td><td><strong><code>any</code></strong></td><td>One or more comma separated values that will be added to the combo. Alternatively, a table of strings that will be added</td></tr><tr><td><strong>...</strong></td><td></td><td></td></tr></tbody></table>

Creates and returns a menu item object, or throws an error on failure.

### :listable&#x20;

`group:listable(name: string, items: any[, ...]):` <mark style="color:purple;">`MenuItem`</mark>

<table><thead><tr><th width="150">Name</th><th width="162.52330706200414">Type</th><th width="410.3276962436035">Description</th></tr></thead><tbody><tr><td><strong>name</strong></td><td><strong><code>string</code></strong></td><td>Item name</td></tr><tr><td><strong>items</strong></td><td><strong><code>any</code></strong></td><td>One or more comma separated values that will be added to the combo. Alternatively, a table of strings that will be added</td></tr><tr><td><strong>...</strong></td><td></td><td></td></tr></tbody></table>

Creates and returns a menu item object, or throws an error on failure.

### :label

`group:label(text: string):` <mark style="color:purple;">`MenuItem`</mark>

<table><thead><tr><th width="150">Name</th><th width="162.52330706200414">Type</th><th width="410.3276962436035">Description</th></tr></thead><tbody><tr><td><strong>text</strong></td><td><strong><code>string</code></strong></td><td>Label text</td></tr></tbody></table>

Creates and returns a menu item object, or throws an error on failure.

### :texture

📌 Create the texture via the [`:load_image`](https://docs-csgo.neverlose.cc/documentation/render#render.line-7) function.

`group:texture(texture: ImgObject[, size: vector, color: color, mode: string, rounding: number]):` <mark style="color:purple;">`MenuItem`</mark>

<table><thead><tr><th width="150">Name</th><th width="162.52330706200414">Type</th><th width="410.3276962436035">Description</th></tr></thead><tbody><tr><td><strong>texture</strong></td><td><strong><code>ImgObject</code></strong></td><td>Image object</td></tr><tr><td><strong>size</strong></td><td><strong><code>vector</code></strong></td><td>Optional. Size of the image</td></tr><tr><td><strong>color</strong></td><td><strong><code>color</code></strong></td><td>Optional. Color of the texture</td></tr><tr><td><strong>mode</strong></td><td><strong><code>string</code></strong></td><td>Optional. <mark style="color:purple;"><code>f</code></mark> for fill, <mark style="color:purple;"><code>r</code></mark> for repeat</td></tr><tr><td><strong>rounding</strong></td><td><strong><code>number</code></strong></td><td>Optional. Image border rounding</td></tr></tbody></table>

Creates and returns a menu item object, or throws an error on failure.

## 🔗 <mark style="color:blue;">`MenuItem`</mark>

### :get

`item:get():` <mark style="color:purple;">`any`</mark>

Returns the value of the menu item.

### :id

`item:id():` <mark style="color:purple;">`number`</mark>

Returns the unique id of the menu item.

### :list

`item:list():` <mark style="color:purple;">`table`</mark>

Returns the list of items. `combo` / `selectable` menu item objects only.

### :type

`item:type():` <mark style="color:purple;">`string`</mark>

Returns the type of the menu item.

### :override

`item:override(value: any[, ...])`

<table><thead><tr><th width="150">Name</th><th width="162.52330706200414">Type</th><th width="410.3276962436035">Description</th></tr></thead><tbody><tr><td><strong>value</strong></td><td><strong><code>any</code></strong></td><td>The value to which the menu item will be set</td></tr><tr><td><strong>...</strong></td><td></td><td></td></tr></tbody></table>

Overrides the item value without changing the menu / config values. If the `value` argument is `nil` or missing, the override is undone.

### :get\_override

`item:get_override():` <mark style="color:purple;">`any`</mark>

Returns the value of the menu item it's overriden to.

### :update

`item:update(...)`

<table><thead><tr><th width="150">Name</th><th width="162.52330706200414">Type</th><th width="410.3276962436035">Description</th></tr></thead><tbody><tr><td><strong>...</strong></td><td><strong><code>any</code></strong></td><td></td></tr></tbody></table>

Updates the values of the menu item.

### :reset

`item:reset()`

Resets the menu item to it's original value.

### :set

`item:set(value: any[, ...])`

<table><thead><tr><th width="150">Name</th><th width="162.52330706200414">Type</th><th width="410.3276962436035">Description</th></tr></thead><tbody><tr><td><strong>value</strong></td><td><strong><code>any</code></strong></td><td>The value to which the menu item will be set</td></tr><tr><td><strong>...</strong></td><td></td><td></td></tr></tbody></table>

Sets the value of the menu item.

### :name

`item:name([value: any])`

<table><thead><tr><th width="150">Name</th><th width="162.52330706200414">Type</th><th width="410.3276962436035">Description</th></tr></thead><tbody><tr><td><strong>value</strong></td><td><strong><code>any</code></strong></td><td>New name</td></tr></tbody></table>

Gets or sets the name of the menu item.

### :tooltip

`item:tooltip([value: any])`

<table><thead><tr><th width="150">Name</th><th width="162.52330706200414">Type</th><th width="410.3276962436035">Description</th></tr></thead><tbody><tr><td><strong>value</strong></td><td><strong><code>any</code></strong></td><td>New tooltip text</td></tr></tbody></table>

Gets or sets the tooltip of the menu item (depending on the presence of the `value` parameter).

### :visibility

`item:visibility([state: boolean])`

<table><thead><tr><th width="150">Name</th><th width="162.52330706200414">Type</th><th width="410.3276962436035">Description</th></tr></thead><tbody><tr><td><strong>state</strong></td><td><strong><code>boolean</code></strong></td><td>New visibility state</td></tr></tbody></table>

Gets or sets the menu item visibility depending on the value of `state`.

### :disabled

`item:disabled([state: boolean])`

<table><thead><tr><th width="150">Name</th><th width="162.52330706200414">Type</th><th width="410.3276962436035">Description</th></tr></thead><tbody><tr><td><strong>state</strong></td><td><strong><code>boolean</code></strong></td><td>New disabled state</td></tr></tbody></table>

Gets or sets the menu item disabled state depending on the value of `state`.

### :set\_callback

`item:set_callback(callback: function[, force_call: boolean])`

<table><thead><tr><th width="150">Name</th><th width="162.52330706200414">Type</th><th width="410.3276962436035">Description</th></tr></thead><tbody><tr><td><strong>callback</strong></td><td><strong><code>function</code></strong></td><td>Function that will be called when the menu item is interacted with</td></tr><tr><td><strong>force_call</strong></td><td><strong><code>boolean</code></strong></td><td>Pass <mark style="color:purple;"><code>true</code></mark> to call the callback function after setup</td></tr></tbody></table>

Sets the callback to the specified menu item.

### :unset\_callback

`item:unset_callback(callback: function)`

<table><thead><tr><th width="150">Name</th><th width="162.52330706200414">Type</th><th width="410.3276962436035">Description</th></tr></thead><tbody><tr><td><strong>callback</strong></td><td><strong><code>function</code></strong></td><td>Lua function that was passed to the <mark style="color:purple;"><code>:set_callback</code></mark> function</td></tr></tbody></table>

Unsets the callback that was set via the <mark style="color:purple;">`:set_callback`</mark> function.

### :color\_picker <a href="#render.line" id="render.line"></a>

{% tabs %}
{% tab title="Simple" %}
`item:color_picker([color: color]):` <mark style="color:purple;">`MenuItem`</mark>

<table><thead><tr><th width="150">Name</th><th width="162.52330706200414">Type</th><th width="410.3276962436035">Description</th></tr></thead><tbody><tr><td><strong>color</strong></td><td><strong><code>color</code></strong></td><td>Optional. Initial color value</td></tr></tbody></table>
{% endtab %}

{% tab title="Multi-Color" %}
`item:color_picker([colors: table]):` <mark style="color:purple;">`MenuItem`</mark>

<table><thead><tr><th width="150">Name</th><th width="162.52330706200414">Type</th><th width="410.3276962436035">Description</th></tr></thead><tbody><tr><td><strong>colors</strong></td><td><strong><code>table</code></strong></td><td>Table containing tables with a string index, and those tables should contain one or multiple color objects. Check UI examples.</td></tr></tbody></table>
{% endtab %}
{% endtabs %}

Attaches a color picker to the current menu item object.

### :create

`item:create():` <mark style="color:purple;">`MenuGroup`</mark>

Attaches a group (gear) to the current menu item object.

### :parent

`item:parent():` <mark style="color:purple;">`MenuItem`</mark> / <mark style="color:purple;">`MenuGroup`</mark>

Returns the parent object of the menu item.
