# UIAPI
API for managing and communicating with the plugin's user interface.

{/* Do not edit this file. It is automatically generated by API Documenter. */}

## UIAPI interface

API for managing and communicating with the plugin's user interface.

**Signature:**

```typescript
interface UIAPI
```

## Example

```ts
// Send message to UI
creator.ui.postMessage({ type: "update", data: someData });

// Listen for messages from UI
creator.ui.onMessage((message) => {
  console.log("Received from UI:", message);
});
```

## Properties

<table>
  <thead>
    <tr>
      <th>
        Property
      </th>

      <th>
        Modifiers
      </th>

      <th>
        Type
      </th>

      <th>
        Description
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        [theme](/en/creator-api/types/uiapi/theme)
      </td>

      <td>
        `readonly`
      </td>

      <td>
        [ThemeTokens](/en/creator-api/types/theme-tokens)
      </td>

      <td>
        Current theme information including CSS tokens
      </td>
    </tr>
  </tbody>
</table>

## Methods

<table>
  <thead>
    <tr>
      <th>
        Method
      </th>

      <th>
        Description
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        [onMessage(pluginMessage)](/en/creator-api/types/uiapi/on-message)
      </td>

      <td>
        Sets up a message handler to receive messages from the plugin UI.
      </td>
    </tr>

    <tr>
      <td>
        [postMessage(pluginMessage)](/en/creator-api/types/uiapi/post-message)
      </td>

      <td>
        Sends a message to the plugin UI
      </td>
    </tr>

    <tr>
      <td>
        [resize(opts)](/en/creator-api/types/uiapi/resize)
      </td>

      <td>
        Resizes the plugin UI window
      </td>
    </tr>

    <tr>
      <td>
        [show(opts)](/en/creator-api/types/uiapi/show)
      </td>

      <td>
        Shows the plugin UI window
      </td>
    </tr>
  </tbody>
</table>
