> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rebellapp.com/llms.txt
> Use this file to discover all available pages before exploring further.

# my.createWebViewContext

> Create a context to control a web-view component.

Create a WebViewContext for communicating with web-view components.

## Parameters

| Property  | Type   | Required | Description                  |
| --------- | ------ | -------- | ---------------------------- |
| webviewId | String | Yes      | ID of the web-view component |

## Return Value

Returns a WebViewContext object.

## WebViewContext Methods

| Method            | Description                    |
| ----------------- | ------------------------------ |
| postMessage(data) | Send a message to the web-view |

## Code Example

```javascript theme={null}
const webViewContext = my.createWebViewContext('myWebView');

webViewContext.postMessage({
  action: 'refresh',
  data: { userId: '123' }
});
```

```xml theme={null}
<web-view id="myWebView" src="https://example.com" onMessage="onWebViewMessage" />
```
