OptionalcolorsCustom colors for the VideoGrid container.
VideoGridColors for available options.
OptionalcontrolPosition of control buttons (flip, zoom) on local tile.
OptionalcustomCustom layout handler for implementing custom layout modes.
When the layout prop is not one of the built-in modes ('grid', 'speaker', 'sidebar'),
this handler is called to calculate tile positions. If no handler is provided for
a custom layout, the grid layout is used as a fallback.
// "Focus" layout - large center tile with small corners
const focusLayout: CustomLayoutHandler = ({ availableWidth, availableHeight, participants, padding }) => {
const positions: Record<string, TilePosition> = {};
const cornerSize = 120;
// Local user in large center area
positions['local'] = {
left: padding + cornerSize,
top: padding + cornerSize,
width: availableWidth - cornerSize * 2,
height: availableHeight - cornerSize * 2,
};
// Participants in corners
const corners = [
{ left: padding, top: padding },
{ left: padding + availableWidth - cornerSize, top: padding },
{ left: padding, top: padding + availableHeight - cornerSize },
{ left: padding + availableWidth - cornerSize, top: padding + availableHeight - cornerSize },
];
participants.forEach((p, i) => {
if (i < corners.length) {
positions[p.userId] = {
...corners[i],
width: cornerSize,
height: cornerSize,
};
}
});
return positions;
};
<VideoGrid
layout="focus"
customLayoutHandler={focusLayout}
/>
OptionalengagementPosition of engagement indicator on video tiles.
OptionalgapGap between tiles in pixels.
OptionalhideHide the local video tile from the grid. When true, the local tile is hidden (display: none) but remains in the DOM so the video element stays attached for WebRTC streaming. Remote participants still see the local user's video.
OptionalindicatorPosition of recording/streaming indicator on local tile.
OptionallabelPosition of name labels on tiles.
OptionallayoutLayout mode for arranging video tiles.
LayoutMode for available modes.
OptionallocalCustom colors for the local VideoTile component. Includes overlay, recording indicator, and mute colors.
OptionallocalCustom icons for the local VideoTile component. Replace default flip, fullscreen, and record icons.
OptionallocalCustom labels for the local VideoTile component. Use for i18n/localization of control tooltips.
OptionallocalRender order for overlay elements on the local tile when they share the same position. Elements listed first appear first (leftmost for horizontal layouts).
OptionallocalRender props for the local VideoTile component. Allows custom overlay and duration formatting.
OptionallocalCustom styles for the local VideoTile component. Controls button sizing, animation, and typography.
OptionallocalDisplay name for the local user. Shown on the local video tile with "(You)" suffix.
HTML element ID for the local video element.
This ID must match the one used when calling client.connectTransports().
OptionalminMinimum tile width in pixels. Used to calculate grid columns in auto-layout mode.
OptionalmoodPosition of mood indicator on video tiles.
OptionalonCallback when an error occurs during grid rendering
OptionalonCallback when the local tile is clicked.
OptionalonCallback when a remote participant's tile is clicked.
The clicked participant's user ID
OptionalparticipantsOverride the participants array (otherwise derived from HiyveProvider context). Use this when you need full control over which participants are displayed.
Participant for the required data structure.
OptionalrenderRender props for advanced VideoGrid customization.
VideoGridRenderProps for available render functions.
OptionalshowShow engagement indicators on video tiles. Requires MoodAnalysisProvider to be available.
OptionalshowShow fit/fill toggle button on video tiles.
OptionalshowShow the flip/mirror button on the local video tile.
OptionalshowShow mood indicators on video tiles. When undefined, automatically enabled if MoodAnalysisProvider is available and enabled.
OptionalshowShow mute status indicators (mic/camera icons).
OptionalshowShow participant names on video tiles.
OptionalshowShow room duration timer on local tile. Timer starts from when the room was created (from context).
OptionalshowShow the fullscreen/zoom button on video tiles.
OptionalstatusPosition of status indicators (mute, hand raised) on remote tiles.
OptionalstylesCustom styles for VideoGrid layout.
VideoGridStyles for available options.
OptionalsxMUI sx prop for additional styling on the container.
OptionaltileCustom colors for remote VideoTile components. Includes avatar palette, indicator colors, etc.
OptionaltileCustom icons for remote VideoTile components. Replace default Material-UI icons with custom ones.
OptionaltileCustom labels for remote VideoTile components. Use for i18n/localization of tooltip text.
OptionaltileRender order for overlay elements on remote tiles when they share the same position. Elements listed first appear first (leftmost for horizontal layouts).
OptionaltileRender props for remote VideoTile components. Allows custom avatar and overlay rendering.
OptionaltileCustom styles for remote VideoTile components. Controls spacing, sizing, and typography.
OptionaltimerPosition of timer on local tile.
Props for the VideoGrid component.
Remarks
VideoGrid is a container component that manages the layout of video tiles for a video conferencing session. Must be used inside a
<HiyveProvider>.It automatically handles:
The component uses absolute positioning to prevent video element remounting when the layout changes, ensuring smooth transitions.
Example
Basic usage inside HiyveProvider:
Example
Speaker mode with timer: