> 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/menu/menu-data.md).

# Menu Data

`LT.Menu.Open(id, data, isQB)` accepts menu data in ox\_lib format by default. Set `isQB` to `true` if you use QB-style tables.

## ox\_lib format (default)

```lua
LT.Menu.Open('my_menu', {
    title = 'Vehicle Shop',
    options = {
        {
            title = 'Buy Vehicle',
            description = 'Purchase a new car',
            icon = 'car',
            onSelect = function()
                -- handle purchase
            end,
        },
        {
            title = 'Sell Vehicle',
            description = 'Sell your current car',
            icon = 'hand-holding-dollar',
            onSelect = function()
                -- handle sell
            end,
        },
    },
})
```

| Field                   | Type     | Description                                         |
| ----------------------- | -------- | --------------------------------------------------- |
| `title`                 | string   | Menu header text                                    |
| `options`               | table    | Array of menu items                                 |
| `options[].title`       | string   | Button label                                        |
| `options[].description` | string   | Subtitle text                                       |
| `options[].icon`        | string   | Icon name                                           |
| `options[].onSelect`    | function | Called when selected                                |
| `options[].disabled`    | boolean  | Grey out the option                                 |
| `options[].canClose`    | boolean  | Allow closing the menu (ox\_lib)                    |
| `options[].args`        | table    | Extra data passed to callbacks                      |
| `options[].metadata`    | table    | Extra metadata for the option                       |
| `options[].menu`        | string   | Submenu ID to open                                  |
| `options[].iconColor`   | string   | Icon color (stripped for image icons on lation\_ui) |

## QB format (`isQB = true`)

```lua
LT.Menu.Open('my_menu', {
    { header = 'Vehicle Shop', isMenuHeader = true },
    { header = 'Buy', txt = 'Purchase a car', icon = 'fas fa-car', params = { event = 'shop:buy' } },
    { header = 'Sell', txt = 'Sell your car', params = { isServer = true, event = 'shop:sell', args = { id = 1 } } },
}, true)
```

| Field             | Type     | Description                                                |
| ----------------- | -------- | ---------------------------------------------------------- |
| `header`          | string   | Button label                                               |
| `txt`             | string   | Subtitle text                                              |
| `icon`            | string   | Font Awesome icon                                          |
| `disabled`        | boolean  | Grey out the option                                        |
| `params.event`    | string   | Event to trigger                                           |
| `params.isServer` | boolean  | Trigger as server event                                    |
| `params.args`     | table    | Event arguments                                            |
| `action`          | function | Override callback (uses bridge internal event for QB-menu) |

{% hint style="info" %}
QB-menu conversion uses an internal bridge event (`ltbridge:client:@Menu:Callback`) on the LTBridge resource.
{% endhint %}

Back to [Menu](/ltbridge/ui-and-interaction/menu.md)
