# RoomClient: lobby property

> The lobby read-only property of the RoomClient interface is a lobby's state, its phase, who is ready and the countdown, or undefined in a room that isn't a lobby.

The **`lobby`** read-only property of the [`RoomClient`](/docs/client/room-client) interface is the state of the lobby the client is in: its phase, who is ready and when the countdown ends.

## Value

An object with these properties, or `undefined` in a room that isn't a lobby:

`phase`
: `"waiting"` while players get ready, `"countdown"` once the countdown runs or `"handing-off"` while the lobby moves its players to the match.

`ready`
: An array of the player IDs of the ready people, in the order they joined, then of every bot.

`startsAt`
: A number: when the countdown ends, in the room's wall-clock milliseconds, to compare with [`serverTime()`](/docs/client/room-client/servertime). `null` outside the countdown.

`min`
: A number: the lobby's `minPlayers`.

`max`
: A number: the lobby's `maxPlayers`.

`failed`
: Why the last handoff failed, until the next countdown: `"players"` when too few people were left, `"limit"` for a room limit, `"spending"` for a spending limit, `"unavailable"` for anything else. `null` when no handoff failed.

## Description

A lobby sends its state after the client's first state update and whenever it changes, and the [`lobby` event](/docs/client/room-client/lobby-event) fires each time. Players change it with [`setLobbyReady()`](/docs/client/room-client/setlobbyready), and the lobby's leader with [`startCountdown()`](/docs/client/room-client/startcountdown) and [`cancelCountdown()`](/docs/client/room-client/cancelcountdown).

## Examples

### Showing the countdown

The lobby screen shows how many players are ready and, during the countdown, the seconds until the match.

```ts
// lobby-screen.ts
import type { RoomClient } from "@irtio/client";

export function lobbyLine(room: RoomClient): string {
  const lobby = room.lobby;
  if (!lobby) return "";
  const now = room.serverTime();
  if (lobby.phase === "countdown" && lobby.startsAt !== null && now !== undefined) {
    return `Starting in ${Math.ceil((lobby.startsAt - now) / 1000)}`;
  }
  if (lobby.phase === "handing-off") return "Starting the match";
  return `${lobby.ready.length} of ${lobby.min} needed are ready`;
}
```

## See also

- [`RoomClient.setLobbyReady()`](/docs/client/room-client/setlobbyready)
- [`handoff` event](/docs/client/room-client/handoff-event)
- [Lobbies and parties](/docs/room/guides/lobbies)
