GitHub

Source

Pictographic representation of the component.

CarouselLayout

The CarouselLayout component displays a list of tracks in a scroll container. It will display as many tiles as possible and overflow the rest.

Import

import { CarouselLayout } from "@livekit/components-react";

Remarks

To ensure visual stability when tiles are reordered due to track updates, the component uses the useVisualStableUpdate hook.

Usage

const tracks = useTracks([Track.Source.Camera]);
<CarouselLayout tracks={tracks}>
<ParticipantTile />
</CarouselLayout>;

Properties

childrenReact.ReactNode
tracksTrackReferenceOrPlaceholder[]
orientation?'vertical' | 'horizontal'

(Optional) Place the tiles vertically or horizontally next to each other. If undefined orientation is guessed by the dimensions of the container.