LiveKit LogoDocs
Real-timeEgress/IngressCloudReference

useGridLayout

The useGridLayout hook tries to select the best layout to fit all tiles. If the available screen space is not enough, it will reduce the number of maximum visible tiles and select a layout that still works visually within the given limitations. As the order of tiles changes over time, the hook tries to keep visual updates to a minimum while trying to display important tiles such as speaking participants or screen shares.

Import

import { useGridLayout } from '@livekit/components-react';

Parameters

#
gridElementReact.RefObject<HTMLDivElement>

#
trackCountnumber

Returns

{
layout: GridLayoutDefinition;
}

On this page

ImportParametersReturns

Previous

Chevron IconuseFocusToggle
LiveKit Logo

Product

SFU

SDKs

Cloud Dashboard

Cloud Status

GitHub Logo