*** id: 50b19693-044c-4c43-aaf1-73fe41589295 title: setLayout slug: /node/reference/video/room-session/set-layout description: setLayout method for the RoomSession class. max-toc-depth: 3 ---------------- [link-4]: /docs/server-sdk/v4/node/reference/video/room-session/events#videopositions [roomsession-41]: /docs/server-sdk/v4/node/reference/video/room-session [video-roomsession-4]: /docs/server-sdk/v4/node/reference/video/room-session/get-layouts ### setLayout * **setLayout**(`params`): `Promise` Sets a layout for the room. You can obtain a list of available layouts with [`getLayouts`][video-roomsession-4]. #### Parameters Object containing the parameters of the method. Name of the layout. Positions to assign as soon as the new layout is set. See [`VideoPositions`][link-4]. #### Returns `Promise` #### Example In this example, we wait for a room to start and then set the layout for that room to `"6x6"`. This example assumes that there is a [`RoomSession`][roomsession-41] already active and that members are joining the room. ```js import { SignalWire } from "@signalwire/realtime-api"; // Initialize the SignalWire client const client = await SignalWire({ project: "ProjectID Here", token: "Token Here" }) // Access video client from the main client const videoClient = client.video; // Setup listener for when a room starts await videoClient.listen({ onRoomStarted: (roomsession) => { console.log("Room started", roomsession.displayName); // Set the 6x6 layout roomsession.setLayout({ name: "6x6", positions: { self: 'auto' } }); roomsession.listen({ onRoomUpdated: (roomsession) => { console.log("Room layout updated", roomsession.layoutName); }, }) } }); ```