> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes.

# setLayout

> Sets the call layout and participant positions.

```ts
setLayout(layout, positions?): Promise<void>
```

Switches the call to a named video layout and (optionally) places specific members into reserved positions.

The gateway's `call.layout.set` verb carries no positions of its own, so when `positions` is provided the SDK issues a `call.member.position.set` per member alongside it, each keyed by that member's own call context. **These operations are not atomic:** the layout is applied first, then each position sequentially, so members may briefly flash into their default slots before being moved.

Targeted members are validated upfront, though — if any of them has no [member call context](/docs/browser-sdk/v4/reference/participant/target) yet, the whole call rejects before a single request is sent and the layout is left unchanged. A member ID that is not in the call at all is skipped with a warning.

The set of valid layout names depends on the call's room configuration and is exposed reactively via [`layouts$`](/docs/browser-sdk/v4/reference/webrtc-call/layouts\$). Member position values come from [`VideoPosition`](/docs/browser-sdk/v4/reference/type-aliases/video-position).

Requires the `setLayout` capability — inspect [`call.capabilities$`](/docs/browser-sdk/v4/reference/webrtc-call/capabilities\$) before exposing layout controls.

## **Parameters**

**`layout`** `string` — required

Layout name. Must be one of the names emitted by [`layouts$`](/docs/browser-sdk/v4/reference/webrtc-call/layouts\$).

---

**`positions`** `Record<string, VideoPosition>`

Optional map of member IDs to [`VideoPosition`](/docs/browser-sdk/v4/reference/type-aliases/video-position) values. When omitted or empty, only the layout is changed and the server assigns positions automatically.

---

## **Returns**

`Promise<void>` — resolves once the server has applied the layout and every requested position.

## **Throws**

* `InvalidParams` — `layout` is not in the call's available layouts.
* [`ParticipantNotReadyError`](/docs/browser-sdk/v4/reference/errors/participant-not-ready-error) — a targeted member's call context has not arrived yet. Thrown before any request is sent.

## **Examples**

### Switch to a grid layout

```ts
await call.setLayout('grid-responsive', {});
```

### Pin a member to a reserved slot

```ts
await call.setLayout('1x1-with-presenter', {
  [participantId]: 'reserved-0',
});
```

## **See**

* [`layouts$`](/docs/browser-sdk/v4/reference/webrtc-call/layouts\$) — observable list of available layout names.
* [`layout$`](/docs/browser-sdk/v4/reference/webrtc-call/layout\$) — currently active layout.
* [`layoutLayers$`](/docs/browser-sdk/v4/reference/webrtc-call/layout-layers\$) — observable of position assignments.