# 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,
})
```

## Related pages

- [Getting Started](/koja-lib/getting-started) — Configuration and Installation for Getting Started.
- [API Reference](/koja-lib/api-reference) — Client API and Server API for API Reference.
- [Frameworks](/koja-lib/frameworks) — Custom Framework and Overview for Frameworks.
- [Inventory](/koja-lib/inventory) — Custom Inventory and Overview for Inventory.
- [Weapon](/koja-lib/weapon) — Utility function for reading the player's current weapon state.
- [Vehicle](/koja-lib/vehicle) — Utility functions for reading vehicle state on the client.
