> For the complete documentation index, see [llms.txt](https://laot7490.gitbook.io/ltbridge/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://laot7490.gitbook.io/ltbridge/ui-and-interaction/input/input-data.md).

# Input Data

`LT.Input.Open(header, data, isQB, submitText)` shows a dialog and returns the player's answers.

## ox\_lib format (default)

Pass an array of field definitions:

```lua
local result = LT.Input.Open('Enter Details', {
    { type = 'input', label = 'Player Name', name = 'name', required = true },
    { type = 'number', label = 'Amount', name = 'amount', min = 1, max = 100 },
    { type = 'select', label = 'Type', name = 'itemType', options = {
        { value = 'food', label = 'Food' },
        { value = 'drink', label = 'Drink' },
    }},
})
-- result.name, result.amount, result.itemType
```

| Field         | Type    | Description                                                                                                          |
| ------------- | ------- | -------------------------------------------------------------------------------------------------------------------- |
| `type`        | string  | `input`, `number`, `checkbox`, `select`, `textarea`, `multi-select`, `slider`, `date`, `date-range`, `time`, `color` |
| `label`       | string  | Field label shown to player                                                                                          |
| `name`        | string  | Key in the returned table                                                                                            |
| `required`    | boolean | Player must fill this in                                                                                             |
| `default`     | any     | Pre-filled value                                                                                                     |
| `password`    | boolean | Mask input as password                                                                                               |
| `options`     | table   | For `select` / `multi-select` — `{ value, label }` pairs                                                             |
| `min` / `max` | number  | For `number` and `slider` types                                                                                      |

{% hint style="info" %}
`lation_ui` uses `{ title, options = inputs }` instead of a bare array when not in QB mode.
{% endhint %}

## QB format (`isQB = true`)

```lua
local result = LT.Input.Open('Amount', {
    header = 'Enter amount',
    inputs = {
        { text = 'Amount', name = 'amount', type = 'number', isRequired = true, placeholder = '0' },
        { text = 'Type', name = 'type', type = 'radio', options = { { text = 'Cash', value = 'cash' } } },
    },
}, true, 'Submit')
```

| Field         | Type    | Description                                     |
| ------------- | ------- | ----------------------------------------------- |
| `text`        | string  | Field label                                     |
| `name`        | string  | Key in returned table                           |
| `type`        | string  | `text`, `number`, `radio`, `checkbox`, `select` |
| `isRequired`  | boolean | Player must fill this in                        |
| `placeholder` | string  | Placeholder text                                |
| `options`     | table   | For radio/checkbox/select                       |

Back to [Input](/ltbridge/ui-and-interaction/input.md)
