From the reference libraryFiveM

TextUI

ox/ox_lib/Interface/Client/textui.mdx

TextUI

lib.showTextUI

Show the TextUI window.

DO NOT run this function every tick, it's intended to be used as a toggle.

```lua
lib.showTextUI(text, options)
```


```ts
import lib from '@overextended/ox_lib/client';

lib.showTextUI(text, options);
```
  • text: string
  • options?: table
    • position?: 'right-center' or 'left-center' or 'top-center' or 'bottom-center'
      • Default: 'right-center'
    • icon?: string or table (array)
    • iconColor?: string
    • iconAnimation?: 'spin' 'spinPulse' 'spinReverse' 'pulse' 'beat' 'fade' 'beatFade' 'bounce' 'shake'
    • style?: React.CSSProperties
    • alignIcon?: 'top' or 'center'
      • Default: 'center'

lib.hideTextUI

Hides the currently visible TextUI window

```lua
lib.hideTextUI()
```


```ts
import lib from '@overextended/ox_lib/client';

lib.hideTextUI();
```

lib.isTextUIOpen

Returns whether Text UI is opened or not. The currently displayed text is returned as the second value.

```lua
local isOpen, text = lib.isTextUIOpen()
```


```ts
import lib from '@overextended/ox_lib/client';

const [isOpen, text] = lib.isTextUIOpen();
```

Usage Example > Basic

    lib.showTextUI('[E] - Fuel vehicle')
    ```
  
  
    ```ts
    import lib from '@overextended/ox_lib/client';

    lib.showTextUI('[E] - Fuel vehicle');
    ```

  

![basic_example](https://i.imgur.com/uZS40fD.png)

## Usage Example > Custom styling

```lua
    lib.showTextUI('[E] - Pick apple', {
        position = "top-center",
        icon = 'hand',
        style = {
            borderRadius = 0,
            backgroundColor = '#48BB78',
            color = 'white'
        }
    })
    ```
  
  
    ```ts
    import lib from '@overextended/ox_lib/client';

    lib.showTextUI('[E] - Pick apple', {
      position: 'top-center',
      icon: 'hand',
      style: {
        borderRadius: 0,
        backgroundColor: '#48BB78',
        color: 'white',
      },
    });
    ```

  

![custom_example](https://i.imgur.com/sy9lPC0.png)
Back to documentation