Component props
The rendered VideoGrid component
Requirement: Must be used inside a <HiyveProvider> component.
Use VideoGrid when you want automatic layout management for all participants in a video call. It handles positioning, sizing, and transitions for you.
When to use VideoGrid vs individual VideoTile components:
Layout Modes:
Key Features:
Component Composition: VideoGrid internally uses VideoTile for remote participants and LocalVideoTile for the local user, passing through configuration props.
Basic usage inside HiyveProvider:
import { HiyveProvider } from '@hiyve/react';
import { VideoGrid } from '@hiyve/react-ui';
function VideoRoom() {
return (
<HiyveProvider client={client} roomName={roomName} userId={userId}>
<Box sx={{ width: '100%', height: '100vh' }}>
<VideoGrid
localVideoElementId="local-video"
localUserName="Me"
/>
</Box>
</HiyveProvider>
);
}
Speaker mode for presentations:
<VideoGrid
localVideoElementId="local-video"
localUserName="Me"
layout="speaker"
styles={{ filmstripHeight: 150 }}
/>
With timer enabled:
<VideoGrid
localVideoElementId="local-video"
localUserName="Me"
showTimer
/>
Full customization:
<VideoGrid
localVideoElementId="local-video"
localUserName="John"
layout="sidebar"
showLocalFlip={true}
showZoom={true}
showMuteIndicators={true}
colors={{ dominantBorder: '#00ff00' }}
styles={{ sidebarWidth: 250 }}
tileColors={{ avatarPalette: ['#ff0000', '#00ff00', '#0000ff'] }}
renderProps={{
renderTileWrapper: (userId, isLocal, content) => (
<Box onClick={() => handleTileClick(userId)}>{content}</Box>
),
renderEmptyState: () => <Typography>Waiting for others...</Typography>,
}}
onParticipantClick={(userId) => setPinnedUser(userId)}
/>
VideoGrid displays all video tiles in an auto-layout container.