# Text UI (/docs/orbit-studios-resources/orbit-dynamichud/interface/text-ui)



# Text UI [#text-ui]

Text UI displays a persistent interaction prompt. Show it once when an interaction becomes available and hide it when the player leaves. Do not call `showTextUI` every frame.

```lua title="Client exports"
exports['orbit-dynamichud-v2']:showTextUI('[E] Open garage', {
    position = 'right-center',
    icon = 'fas fa-warehouse',
    iconColor = '#71B6F7'
})

-- When the interaction is no longer available:
exports['orbit-dynamichud-v2']:hideTextUI()
```

The event form is useful from bridge resources:

```lua title="Client events"
TriggerEvent('orbit-dynamichud:showTextUI', '{key:E} Open garage', {
    position = 'left-center'
})

TriggerEvent('orbit-dynamichud:hideTextUI')
```

A server script can target one player with the same events:

```lua title="Server events"
TriggerClientEvent('orbit-dynamichud:showTextUI', source, '[E] Continue')
TriggerClientEvent('orbit-dynamichud:hideTextUI', source)
```

## Options [#options]

| Option          | Type      | Default          | Description                                                                                    |                                                                                |
| --------------- | --------- | ---------------- | ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ |
| `position`      | `string?` | `"right-center"` | `right-center`, `left-center`, `top-center`, or `bottom-center`.                               |                                                                                |
| `icon`          | \`string  | string\[]?\`     | none                                                                                           | Free Font Awesome icon name/classes. An array is joined into one class string. |
| `iconColor`     | `string?` | white            | CSS icon color.                                                                                |                                                                                |
| `iconAnimation` | `string?` | none             | `spin`, `spinPulse`, `spinReverse`, `pulse`, `beat`, `fade`, `beatFade`, `bounce`, or `shake`. |                                                                                |
| `alignIcon`     | `string?` | `"center"`       | `center` or `top`.                                                                             |                                                                                |
| `style`         | `table?`  | none             | Sanitized CSS overrides. Camel-case names are accepted; numeric dimensions become pixels.      |                                                                                |

Use `[E]` or `{key:E}` to render a key marker. Newlines create multiple lines.

```lua title="Multiline prompt"
exports['orbit-dynamichud-v2']:showTextUI('{key:E} Search\nPolice may be alerted', {
    position = 'bottom-center',
    icon = { 'fas', 'fa-magnifying-glass' },
    iconAnimation = 'pulse',
    alignIcon = 'top',
    style = {
        maxWidth = '28vh',
        opacity = 0.95
    }
})
```

Query its state and current text:

```lua
local isOpen, currentText = exports['orbit-dynamichud-v2']:isTextUIOpen()
```

## ox\_lib drop-in replacement [#ox_lib-drop-in-replacement]

```lua title="client/orbit_textui.lua"
lib = lib or {}

lib.showTextUI = function(text, options)
    return exports['orbit-dynamichud-v2']:showTextUI(text, options)
end

lib.hideTextUI = function()
    return exports['orbit-dynamichud-v2']:hideTextUI()
end

lib.isTextUIOpen = function()
    return exports['orbit-dynamichud-v2']:isTextUIOpen()
end
```

This preserves the ox\_lib signatures and both return values from `lib.isTextUIOpen()`. Existing calls require no edits.

Showing new text replaces the active prompt. Explicitly call `hideTextUI` during interaction cleanup and resource stop.
