# Menu

#### 1. Registering a Tab:

To create a tab, you must register a tab and its columns.

```lua
-- UI.RegisterTab(TabName, Col1_ID, Col2_ID, Col3_ID)
UI.RegisterTab("My Script", "Column_Main", "Column_Visuals", "Column_Misc")
```

#### 2. Adding the columns:

Each column is populated by registering a function to the Column ID you created.

```lua
Events.Register("Column_Main", function()
    UI.Text("Main Features", true) -- 'true' highlights text in the special feature color
    
    UI.Button("Print Hello", false, function()
        print("Hello World!")
    end)
end)
```

#### 3. Functions:

#### Text:

```lua
UI.Text(str, accent) 
```

* str (string): The label you want to display.
* accent (boolean): A toggle to determine the text color. If this boolean is `true`, the text will glow in the special feature color; if `false`, it remains the standard text color.

#### Checkbox:

```lua
UI.Checkbox(str, default, callback)
```

* str (string): The label you want to display.
* default (boolean): The initial state of the checkbox when the script loads.
* callback (function): A function that triggers whenever the state changes, returning a boolean (`true` for checked, `false` for unchecked).

#### Button:

```lua
UI.Button(str, accent, callback)
```

* str (string): The label you want to display.
* accent (boolean): A boolean that controls the button's color. When `true`, the button text is with the special feature color.
* callback (function): The code to be executed when the user clicks the button.

#### Slider:

```lua
UI.Slider(str, accent, min, max, callback)
```

* str (string): The label you want to display.
* accent (boolean): A boolean that controls the slider's color. When `true`, the slider text is with the special feature color.
* min / max (number): The boundaries of the slider.
* callback (function): Returns the selected number.

#### Combo:

```lua
UI.Combo(str, accent, {items}, callback)
```

* str: The label you want to display.
* accent (bool): A boolean that controls the combo's text color. When `true`, the combo text is with the special feature color.
* {items}: A table of strings, e.g., `{"Method A", "Method B"}`.
* callback: Returns the name of the item selected.

#### ColorPicker:

```lua
UI.ColorPicker(str, callback)
```

* str: The label you want to display.
* callback: Returns a Color Object. You can get the specific values using `.r`, `.g`, `.b`, and `.a`.

**Keybind:**

```lua
UI.CreateKeybind(str)
UI.RenderKeybind(str)
UI.IsKeybindEnabled(str)
UI.DestroyKeybind(str)
```

* `str` (string): A unique ID for the keybind.
* `CreateKeybind`: Creates a new keybind with the given ID. Call this once at the top of your script before registering any tabs.
* `RenderKeybind`: Renders the interactive keybind widget inline in a column. Right click to set Hold/Toggle/Always, left click to bind a key.
* `IsKeybindEnabled`: Returns a boolean — `true` if the keybind is currently active.
* `DestroyKeybind`: Removes the keybind. Called automatically when the script unloads.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://yerba-1.gitbook.io/yerba-docs/getting-started/publish-your-docs.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
