# UIIframeElement

***

Represents an iframe element in a panel.

The height of the iframe can be set by using the `height` property either as a number (measured in pixels) or a string (e.g. “100px” or “50%“).

By default, the height is calculated following a 16:9 ratio.

<figure><img src="/files/tOoIGZ8XxDxiFYWv12uc" alt="Iframe showing an example website"><figcaption><p>Iframe with default height (16:9)</p></figcaption></figure>

```typescript
{ type: "Iframe", url: "https://www.example.com" }
```

<figure><img src="/files/vewSff7vROIy5GuGZo3V" alt="Iframe showing an example website with a custom height"><figcaption><p>Iframe with custom height</p></figcaption></figure>

```typescript
{ type: "Iframe", url: "https://www.example.com", height: 300 }
```

## Properties

### type

> **type**: `"Iframe"`

***

### url

> **url**: `string`

The URL of the iframe.

***

### id

> **id**: `string`

The ID of the element.

***

### height?

> `optional` **height**: `string` | `number`

The height of the iframe.

If not provided, the height will be automatically calculated following a 16:9 ratio.

***

### onCreate()?

> `optional` **onCreate**: (`args`: { `id`: `string`; }) => `void`

A function to call when the element is created.

#### Parameters

| Parameter | Type                | Description                           |
| --------- | ------------------- | ------------------------------------- |
| `args`    | { `id`: `string`; } | The arguments passed to the function. |
| `args.id` | `string`            | The id of the element.                |

#### Returns

`void`

***

### onDestroy()?

> `optional` **onDestroy**: (`args`: { `id`: `string`; }) => `void`

A function to call when the element is destroyed.

#### Parameters

| Parameter | Type                | Description                           |
| --------- | ------------------- | ------------------------------------- |
| `args`    | { `id`: `string`; } | The arguments passed to the function. |
| `args.id` | `string`            | The id of the element.                |

#### Returns

`void`


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.felt.com/js-sdk-api-reference/ui/uiiframeelement.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
