# addCustomTile()

Adds a custom tile as a **first** or **last** position in the tiles list. You defined the content of the tile with the **html** property. Name is the title of the tile.

{% hint style="info" %}
The custom tile is always shown on the current page at your chosen position (first or last).
{% endhint %}

{% hint style="warning" %}
The method must be called after you have joined the room. It won't do anything if the room hasn't loaded yet.&#x20;
{% endhint %}

In the below example a custom AI tile is added to the stage.

```javascript
sambaFrame.on('userJoined', (event) => {
   const data = event.data;
   if (data.type === 'local') {
     sambaFrame.addCustomTile({
        "name": "AI", 
        "html": '<img src="https://media0.giphy.com/media/v1.Y2lkPTc5MGI3NjExdjR5YjF5dWQ4d2d2NzI5eHFyYmxyczgydzRuZ2JwZ2F4MTliaGo2bCZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/MHMO7iYMt6pJrEpKNB/giphy.gif"/>',
        "position": "last"
     });
   }
});
```

{% hint style="info" %}
This method is often used in conjunction with [removeCustomTile()](/reference/sdk/methods/removecustomtile.md) and [sendMessageToCustomTile()](/reference/sdk/methods/sendmessagetocustomtile.md).
{% endhint %}


---

# 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://docs.digitalsamba.com/reference/sdk/methods/addcustomtile.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.
