> For the complete documentation index, see [llms.txt](https://docs.kojascripts.eu/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kojascripts.eu/koja-lib/text-ui.md).

# Text UI

A small on-screen prompt that shows an action key and a label. Typically used near interaction zones.

## showTextUI

Show the Text UI.

```lua
showTextUI(data)

-- or via export:
exports['koja-lib']:showTextUI(data)
```

| Field   | Type     | Default                     | Description                      |
| ------- | -------- | --------------------------- | -------------------------------- |
| `key`   | `string` | `"E"`                       | Key name displayed on the prompt |
| `label` | `string` | `"Action"`                  | Short label next to the key      |
| `desc`  | `string` | `"Press to perform action"` | Description text                 |

## hideTextUI

Hide the Text UI.

```lua
hideTextUI()

-- or via export:
exports['koja-lib']:hideTextUI()
```

## isTextUIOpen

Returns whether the Text UI is currently visible and the current data.

```lua
local open, current = isTextUIOpen()

-- or via export:
local open, current = exports['koja-lib']:isTextUIOpen()
```

**Returns**

* `open` — `boolean`
* `current` — `table | nil` — the data passed to the last `showTextUI` call

## Theme

```lua
Config.UI.TextUI = {
    theme        = "darkBlack",  -- orange | darkGray | darkBlack | navy | green | purple | red
    bottomOffset = 5.5,
}
```

## Example

```lua
local point = KOJA.Client.points.new({
    coords   = vector3(100.0, 200.0, 30.0),
    distance = 2.0,

    onEnter = function(self)
        showTextUI({
            key   = 'E',
            label = 'ATM',
            desc  = 'Access your bank account',
        })
    end,

    onExit = function(self)
        hideTextUI()
    end,
})
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://docs.kojascripts.eu/koja-lib/text-ui.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.
