> Agent-readable docs index: /llms.txt. Download /docs.zip to grep all markdown files locally.

---
title: panorama
description: Panorama UI integration
icon: layout-dashboard
---

The `panorama` namespace integrates with the game's Panorama UI, letting you run JavaScript and access Panorama APIs from Lua.

## loadstring

```lua
panorama.loadstring(js_code: string[, panel: string]): any
```

> Compiles a string of JavaScript code and returns the result.

<Schema title="Parameters">
  <SchemaField name="js_code" type="string" required>
    String containing JavaScript code
  </SchemaField>

  <SchemaField name="panel" type="string (panorama root panel)">
    Optional. Panel name
  </SchemaField>
</Schema>

<Schema title="Returns">
  <SchemaField name="result" type="any">
    The result of the compiled JavaScript code.
  </SchemaField>
</Schema>

## Accessing API's

> Index `panorama` with an API name to access a Panorama API. Optionally specify a root panel before the API name.

```lua
panorama[api]: table
```

<Schema title="Parameters">
  <SchemaField name="api" type="string" required>
    API name, e.g. GameStateAPI
  </SchemaField>
</Schema>

<Schema title="Returns">
  <SchemaField name="api_table" type="table">
    The accessed Panorama API.
  </SchemaField>
</Schema>

```lua
panorama[panel][api]: table
```

<Schema title="Parameters">
  <SchemaField name="panel" type="string (panorama root panel)" required>
    Panel name
  </SchemaField>

  <SchemaField name="api" type="string" required>
    API name, e.g. GameStateAPI
  </SchemaField>
</Schema>

<Schema title="Returns">
  <SchemaField name="api_table" type="table">
    The accessed Panorama API.
  </SchemaField>
</Schema>

<Expandable title="Example">
  ```lua lines=false
  -- Access an API from the default root panel
  local MyPersonaAPI = panorama.MyPersonaAPI

  print(MyPersonaAPI.GetXuid())

  -- Access an API from a specific root panel
  local UiToolkitAPI = panorama.CSGOMainMenu.UiToolkitAPI

  UiToolkitAPI.CloseAllVisiblePopups()
  ```
</Expandable>
