Video SDK UI Toolkit 2.0 API Reference

View as Markdown

Use this component and hook API reference after you have a working session. Every example assumes it renders inside ZoomUIToolkitProvider and that the stylesheet is imported once.

API layers

LayerWhat you get
AppZoomUIToolkitApp: the complete session UI
ModulesToolbar, TopBar, ParticipantView, MobileParticipantView, ActiveSpeakerView, ShareViewerView, SharePresenterView
ComponentsButtons: JoinButton, LeaveButton, AudioButton, VideoButton, ShareButton, RecordButton, ParticipantButton, ChatButton, SettingsButton, SessionInfoButton, MoreButton, ToolbarButton. Panels: ParticipantPanel, SettingsPanel, SessionInfoPanel, ReclaimHostBanner. Video: VideoLayout, MobileVideoLayout, ParticipantTile, ShareViewLayout, ShareTile. Theme: ThemeProvider
HooksuseZoomUIToolkit, useAudioController, useVideoController, useShareController, useRecordingController, useTheme

Modules

Toolbar

The session control bar: Audio, Video, Participants, Chat, Share, Record, Settings, More, and Leave. Every control except More is disabled until the session is connected, and controls that don't fit move into More. It switches to the mobile layout on its own. Record works only for a host or co-host when cloud recording is available; Share is disabled on phones and tablets.

import { Toolbar } from '@zoom/videosdk-ui-toolkit';
export function MeetingControls() {
  return (
    <Toolbar
      visibleButtons={{ audio: true, video: true, participant: true, chat: true, share: true, leave: true }}
      chatButtonProps={{ messageBubbleStyles: { outgoing: { backgroundColor: '#0b5cff' } } }}
      style={{ backgroundColor: '#1f1f1f' }}
    />
  );
}
  • visibleButtons: ToolbarButtonVisibility. Omit it to show every control; when set, only true entries appear. More is always visible and contains only included controls that overflow the toolbar; omitted or false entries remain hidden.
  • isHorizontal: boolean, default true. Set false for a vertical bar and give the container a height.
  • style and className.
  • audioButtonProps, videoButtonProps, chatButtonProps, recordButtonProps: passed to the matching button; isMobile is set for you. Participants, Share, Settings, and Leave use their defaults. To reorder or add controls, build your own bar from the buttons in Components.

TopBar

The session header: a session info button (with the session name on desktop) and a recording indicator on the left, your own controls on the right.

import { LeaveButton, TopBar } from '@zoom/videosdk-ui-toolkit';
export function Header() {
  return <TopBar style={{ backgroundColor: '#111' }} customizedButtons={[<LeaveButton key='leave' />]} />;
}
  • customizedButtons: ReactNode[], rendered on the right in array order.
  • style and className.
  • The Session Info panel it opens has no invite link. For one, put SessionInfoButton in your own header.

ParticipantView

A paginated grid of participant videos with previous/next buttons and a page indicator. It fills its parent, so give the parent a size. Remote participants with video on are listed before those with video off.

import { ParticipantView } from '@zoom/videosdk-ui-toolkit';
export function Gallery() {
  return (
    <div style={{ height: '70vh' }}>
      <ParticipantView pageSize={9} isShowSelf style={{ backgroundColor: '#000' }} />
    </div>
  );
}
  • pageSize: number, default 4. A page never shows more tiles than the device can render.
  • tileAspectRatio: number, default 16 / 9. isShowSelf: boolean, default true.
  • paginationDirection: 'horizontal' | 'vertical', default 'horizontal'. hidePagination: boolean, default false.
  • style: backgroundColor and color also apply to the tiles. Also className and hidden (keeps the view mounted).

MobileParticipantView

Swipeable pages of up to four participants with page dots, for phones. A received screen share appears as the first page. Only the page on screen plays video.

import { MobileParticipantView } from '@zoom/videosdk-ui-toolkit';
export function MobileGallery() {
  return (
    <div style={{ height: '100dvh' }}>
      <MobileParticipantView paginationDirection='vertical' />
    </div>
  );
}
  • isShowSelf (default true), paginationDirection (swipe direction, default 'horizontal'), hidePagination (hides the dots; swiping still works), hidden, style, className.

ActiveSpeakerView

One large tile for the participant the Video SDK reports as the active video user. It switches automatically and shows the name when that participant's video is off.

import { ActiveSpeakerView } from '@zoom/videosdk-ui-toolkit';
export function Spotlight() {
  return (
    <div style={{ height: '70vh' }}>
      <ActiveSpeakerView tileAspectRatio={4 / 3} style={{ backgroundColor: '#000' }} />
    </div>
  );
}
  • tileAspectRatio (default 16 / 9), hidden, style (backgroundColor and color also apply to the tile), className.

ShareViewerView

Screen shares from other participants. By default it shows the active share with a "You are viewing {name}'s screen" banner and a View Options menu (Fit to window or Original size). With isMultiShareRender, it shows every received share in a paginated grid.

import { ShareViewerView, useZoomUIToolkit } from '@zoom/videosdk-ui-toolkit';
export function ShareStage() {
  const { shareState } = useZoomUIToolkit();
  return (
    <div style={{ height: '70vh' }}>
      <ShareViewerView hidden={!shareState.isReceivingShare} />
    </div>
  );
}
  • isMultiShareRender: boolean, default false. pageSize (default 4) and tileAspectRatio apply in multi-share mode.
  • paginationDirection, hidePagination, hidden, style, className.

SharePresenterView

A preview of your own screen share, scaled to fit its container. It is empty while you are not sharing.

import { SharePresenterView, useShareController } from '@zoom/videosdk-ui-toolkit';
export function MySharePreview() {
  const { isSharing } = useShareController();
  return <SharePresenterView hidden={!isSharing} style={{ width: '100%', height: '40vh' }} />;
}
  • style (set the size here or on the parent), hidden, className.

Components

JoinButton

Joins with the credentials in joinParameters. Fetch the token from the auth server first with the Quickstart's requestSessionToken and config, as the following example does. Fetch a fresh token when the session or role changes, and refresh expired tokens before another join. The button is disabled until the provider has a client, while topic or userName is empty, and while a join is in progress.

import { useEffect, useState } from 'react';
import { JoinButton, useZoomUIToolkit } from '@zoom/videosdk-ui-toolkit';
import { requestSessionToken } from './auth';
import { config } from './config';

export function JoinForm() {
  const { sessionState } = useZoomUIToolkit();
  const [token, setToken] = useState<string | null>(null);
  const [authError, setAuthError] = useState('');

  useEffect(() => {
    const controller = new AbortController();
    requestSessionToken(
      { endpoint: config.authEndpoint, sessionName: config.topic, role: config.role },
      controller.signal,
    )
      .then(setToken)
      .catch((error: unknown) => {
        if (!controller.signal.aborted) {
          setAuthError(error instanceof Error ? error.message : 'Unable to load a token.');
        }
      });
    return () => controller.abort();
  }, []);

  if (authError) return <p role='alert'>{authError}</p>;
  if (!token) return <p role='status'>Preparing session credentials…</p>;
  return (
    <>
      <JoinButton
        fullWidth
        joinParameters={{ topic: config.topic, token, userName: config.userName, sessionPassword: config.sessionPassword }}
      />
      {sessionState.errorMessage && <p role='alert'>{sessionState.errorMessage}</p>}
    </>
  );
}
  • joinParameters (required): { topic, token, userName, sessionPassword?, sessionIdleTimeoutMins? }.
  • fullWidth (default false), style, className.

LeaveButton

Participants and co-hosts leave as soon as they click. The host gets "End meeting for all" and "Leave meeting"; with others present, "Leave meeting" asks the host to pick a new host first.

import { LeaveButton } from '@zoom/videosdk-ui-toolkit';
export function LeaveControl() {
  return <LeaveButton popoverProps={{ side: 'top', align: 'end' }} />;
}
  • isMobile (host menu as a bottom sheet), onClick (runs even if leaving fails; check sessionState.connectionState), renderContent (custom trigger), popoverProps / anchor.
  • style, className, fullWidth, menuClassName, menuStyle.

AudioButton

Joins audio on the first click, then mutes and unmutes. Once audio is joined, its menu lets users pick a microphone and speaker or leave audio. While it is on-screen it also shows the speaking-while-muted and muted-by-host notices and the host's ask-to-unmute dialog.

import { AudioButton, type ToolbarMenuGroup } from '@zoom/videosdk-ui-toolkit';
export function MicControl({ onHelp }: { onHelp: () => void }) {
  const helpGroup: ToolbarMenuGroup = {
    id: 'help',
    items: [{ id: 'audio-help', label: 'Audio help', onSelect: onHelp }],
  };
  return <AudioButton menuGroups={[helpGroup]} />;
}
  • isMobile, showMenu (default true), menuGroups (added after the device options).
  • renderContent: keys joinAudio, muted, unmuted, loading, warning; each a node or a function of the button state.
  • style, className, dropdownOptions.

VideoButton

Starts and stops the camera. A camera menu is available once the camera has been turned on.

import { VideoButton } from '@zoom/videosdk-ui-toolkit';
export function CameraControl() {
  return <VideoButton renderContent={{ videoOff: ({ label }) => <span>{label}</span> }} />;
}
  • isMobile, showMenu (default true), menuGroups.
  • renderContent: keys videoOn, videoOff, loading, warning.
  • style, className, dropdownOptions.

ShareButton

Starts screen sharing. While sharing, a floating bar you can drag offers pause, resume, stop, and sharing options. Hosts and co-hosts also get a menu to change who can share. Disabled on phones and tablets.

import { ShareButton, useShareController } from '@zoom/videosdk-ui-toolkit';
export function ShareControls() {
  const { isSharing, stopShare } = useShareController();
  return (
    <>
      <ShareButton showPresenterControl={false} />
      {isSharing && <button onClick={() => void stopShare()}>Stop sharing</button>}
    </>
  );
}
  • showPresenterControl (default true; if hidden, stop sharing with useShareController().stopShare), showMenu, menuGroups.
  • renderContent: keys idle and sharing. style, className, dropdownOptions. No isMobile prop.

RecordButton

Cloud recording. A click starts recording; while recording or paused, a click opens Pause or Resume and Stop. Only a host or co-host can use it, and only when cloud recording is available.

import { RecordButton } from '@zoom/videosdk-ui-toolkit';
export function RecordControl() {
  return <RecordButton dropdownOptions={{ side: 'top', align: 'center' }} />;
}
  • isMobile, showMenu (default true; with false the button can't pause or stop), menuGroups (shown while recording or paused), style, className, dropdownOptions.

ParticipantButton

Shows the participant count and opens the participant list: a panel you can drag on desktop, or a bottom sheet with isMobile.

import { ParticipantButton } from '@zoom/videosdk-ui-toolkit';
export function PeopleButton() {
  return <ParticipantButton panelStyle={{ maxHeight: '60vh' }} />;
}
  • isMobile, onOpen / onClose, renderContent (replaces the icon; the count stays), panelClassName / panelStyle, anchor / popoverProps, style, className.

ParticipantPanel

The participant list without a button: search, per-participant actions based on your role, Mute All for hosts and co-hosts, and Reclaim host when eligible. It doesn't hide itself; set open to false in onClose.

import { useState } from 'react';
import { ParticipantPanel } from '@zoom/videosdk-ui-toolkit';
export function PeopleSidebar() {
  const [open, setOpen] = useState(true);
  return (
    <aside>
      {!open && <button onClick={() => setOpen(true)}>Participants</button>}
      <ParticipantPanel open={open} onClose={() => setOpen(false)} />
    </aside>
  );
}
  • open (default true), onClose (shows a close button), anchor and placement ('top' | 'bottom'; omit anchor to render inline), isMobile, style, className.

ChatButton

Opens session chat with an unread badge. Users pick a recipient, send, and delete their own messages; hosts and co-hosts can delete any message and set chat privileges. A panel you can drag on desktop, a bottom sheet on mobile.

import { ChatButton } from '@zoom/videosdk-ui-toolkit';
export function ChatControl() {
  return (
    <ChatButton
      onMessageSent={(_message, receiverId) => console.log(receiverId === 0 ? 'to everyone' : 'direct')}
      messageBubbleStyles={{ outgoing: { backgroundColor: '#0b5cff', color: '#fff' } }}
    />
  );
}
  • isMobile, onMessageSent(message, receiverId) (receiverId is 0 for everyone), messageBubbleStyles ({ incoming?, outgoing? }).
  • onOpen / onClose, panelClassName / panelStyle, anchor / popoverProps, renderContent, style, className.

SettingsButton

Opens Settings with Audio, Video, Share screen, and Statistics tabs: a panel you can drag on desktop, a bottom sheet on mobile.

import { SettingsButton } from '@zoom/videosdk-ui-toolkit';
export function SettingsControl() {
  return <SettingsButton panelProps={{ tabs: ['audio', 'video', 'qos'] }} />;
}
  • isMobile, panelProps (tabs, testSoundUrl), onOpen / onClose, panelClassName / panelStyle, anchor / popoverProps, renderContent, style, className.

SettingsPanel

The settings content on its own, for your own container. Microphone and speaker tests appear only if you pass localAudioTrack to the provider.

import { useState } from 'react';
import { SettingsPanel, type SettingsTab } from '@zoom/videosdk-ui-toolkit';
export function SettingsDialog({ onClose }: { onClose: () => void }) {
  const [tab, setTab] = useState<SettingsTab>('video');
  return <SettingsPanel activeTab={tab} onTabChange={setTab} tabs={['audio', 'video', 'qos']} onClose={onClose} />;
}
  • tabs: SettingsTab[] ('audio' | 'video' | 'share' | 'qos'), default all four, in the order given.
  • activeTab / onTabChange, open (default true), onClose, isMobile, testSoundUrl, style, className.

SessionInfoButton and SessionInfoPanel

An info button with the session name that opens the session topic, session ID, your name, and user ID, plus an optional invite link with a copy action. The session password is never shown. SessionInfoPanel shows the same details without a button.

import { SessionInfoButton } from '@zoom/videosdk-ui-toolkit';
export function InfoControl({ inviteLink }: { inviteLink: string }) {
  return <SessionInfoButton inviteLink={inviteLink} />;
}
  • Button: inviteLink, showSessionName (default true), isMobile, ariaLabel, onOpen / onClose, panelClassName / panelStyle, anchor / popoverProps, renderContent, style, className.
  • Panel: open (default true), inviteLink, onClose, anchor, placement (default 'bottom'), isMobile, style, className.

MoreButton

A menu of the controls you pass, in order: a popover on desktop and a bottom sheet on mobile, detected automatically.

import { MoreButton, SettingsButton, ToolbarButton } from '@zoom/videosdk-ui-toolkit';
export function Overflow({ onHelp }: { onHelp: () => void }) {
  return (
    <MoreButton
      buttons={[
        <SettingsButton key='settings' />,
        <ToolbarButton key='help' renderContent={() => null} onClick={onHelp}>
          Help
        </ToolbarButton>,
      ]}
    />
  );
}
  • buttons: ReactNode[] with stable keys; an empty list shows "No additional controls".
  • isMobile (overrides detection), menuClassName / menuStyle, style / className for the trigger.

ToolbarButton

A native button styled like the built-in controls, for your own actions. It forwards a ref and all native button props. Without renderContent it shows a placeholder icon; pass renderContent={() => null} for text only.

import { ToolbarButton, useAudioController } from '@zoom/videosdk-ui-toolkit';

export function AudioAction() {
  const { audioState, canControlAudio, toggleAudio } = useAudioController();
  const label = !audioState.isJoined ? 'Join audio' : audioState.isMuted ? 'Unmute' : 'Mute';

  return (
    <ToolbarButton
      fullWidth
      active={audioState.isJoined && !audioState.isMuted}
      disabled={!canControlAudio || audioState.isLoading}
      renderContent={() => null}
      onClick={() => { void toggleAudio(); }}
    >
      {label}
    </ToolbarButton>
  );
}
  • renderContent, active (default false), tone ('neutral' | 'accent' | 'danger'), size ('sm' | 'md' | 'lg'), fullWidth, and any native button prop.

ReclaimHostBanner

Lets the original host (token role_type 1) take back the host role. The provider already shows this banner; to place it yourself, turn off the built-in one so it doesn't appear twice.

import { ReclaimHostBanner, ZoomUIToolkitProvider, type SessionOptions } from '@zoom/videosdk-ui-toolkit';
const sessionOptions: SessionOptions = { session: { disableReclaimHostBanner: true } };
<ZoomUIToolkitProvider clientInstance={client} sessionOptions={sessionOptions}>
  <ReclaimHostBanner className='my-reclaim-banner' />
  <Viewport />
</ZoomUIToolkitProvider>;
  • className, style, withOwnViewport (default true; keep the default).

VideoLayout and MobileVideoLayout

VideoLayout arranges the participants you pass in an evenly sized grid that fits the width and height you give it; ParticipantView is built on it. Use it to handle sizing, filtering, or pagination yourself. MobileVideoLayout shows up to four participants in a fixed grid for small screens.

import { useZoomUIToolkit, VideoLayout } from '@zoom/videosdk-ui-toolkit';
export function StageGrid({ width, height }: { width: number; height: number }) {
  const { participantState } = useZoomUIToolkit();
  const withVideo = participantState.participants.filter((p) => p.bVideoOn);
  return <VideoLayout participants={withVideo} width={width} height={height} videoTileAspectRatio={4 / 3} />;
}
  • VideoLayout: participants, width, height (required), videoTileAspectRatio (default 16 / 9), minTileWidth, gap, activeSpeakerBorder (default true).
  • MobileVideoLayout: participants (at most four shown), width, height, renderVideo (default true), activeSpeakerBorder, gap.

ParticipantTile

One participant's video with a name tag, or their name when video is off. Most applications should use ParticipantView, MobileParticipantView, or VideoLayout, which manage the video container for you. For an advanced custom filmstrip built from ParticipantTile, place all participant tiles inside one <video-player-container> and keep share tiles in separate containers.

If TypeScript reports an unknown video-player-container element when using this advanced example, add the following React 19 declaration to your project. The session modules do not require this manual declaration.

// video-player-container.d.ts (include in your TypeScript project)
import type { DetailedHTMLProps, HTMLAttributes } from 'react';

declare module 'react' {
  namespace JSX {
    interface IntrinsicElements {
      'video-player-container': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
    }
  }
}
import { ParticipantTile, useZoomUIToolkit } from '@zoom/videosdk-ui-toolkit';
export function Filmstrip() {
  const { participantState } = useZoomUIToolkit();
  const activeId = participantState.activeVideoUser?.userId;
  return (
    <video-player-container style={{ display: 'flex' }}>
      {participantState.participants.map((p) => (
        <ParticipantTile key={p.userId} participant={p} width={240} height={135} isActive={p.userId === activeId} />
      ))}
    </video-player-container>
  );
}
  • participant, width, height (required), aspectRatio (default 16 / 9), videoQuality (default VideoQuality.Video_360P from @zoom/videosdk), isActive, activeClassName, activeStyle, customNameTag, renderVideo, style, className.

ShareViewLayout and ShareTile

ShareViewLayout arranges shared screens in a grid labeled "{name}'s screen"; ShareViewerView is built on it. ShareTile shows one participant's shared screen at the size you give it, in its own <video-player-container>.

import { ShareViewLayout, useZoomUIToolkit } from '@zoom/videosdk-ui-toolkit';
export function SharesGrid({ width, height }: { width: number; height: number }) {
  const { participantState } = useZoomUIToolkit();
  const sharers = participantState.activeShareUsersList;
  if (sharers.length === 0) return null;
  return <ShareViewLayout participants={sharers} width={width} height={height} />;
}
  • ShareViewLayout: participants, width, height (required), shareTileAspectRatio (default 16 / 9), minTileWidth, gap.
  • ShareTile: participant (Participant | null), width, height (required), fitToContent, showContentOriginalSize, aspectRatio, customNameTag, style, className.

ZoomUIToolkitRoot

Optional wrapper for grouping a custom Component mode layout in the page’s stacking order. It renders a positioned, isolated <div> and inherits baseZIndex from ZoomUIToolkitProvider. See Group components for stacking.

  • children (required): the custom layout. Set baseZIndex on the provider.

ThemeProvider

Gives part of your layout a different theme without adding an element to the page. See Dark and light themes.

  • theme (required): 'light' | 'dark'. children (required).

Hooks

Use the hooks to build your own controls. Controller actions never reject: failures appear in state (for example audioState.warning) or as a notification.

import {
  ConnectionState,
  useAudioController,
  useRecordingController,
  useShareController,
  useTheme,
  useVideoController,
  useZoomUIToolkit,
} from '@zoom/videosdk-ui-toolkit';
export function CustomControls() {
  const { sessionState } = useZoomUIToolkit();
  const audio = useAudioController();
  const video = useVideoController();
  const share = useShareController();
  const recording = useRecordingController();
  const theme = useTheme();
  const connected = sessionState.connectionState === ConnectionState.Connected;
  return (
    <div data-theme={theme}>
      <button disabled={!connected || !audio.canControlAudio} onClick={() => void audio.toggleAudio()}>
        {!audio.audioState.isJoined ? 'Join audio' : audio.audioState.isMuted ? 'Unmute' : 'Mute'}
      </button>
      <button disabled={!connected || !video.canControlVideo} onClick={() => void video.toggleVideo()}>
        {video.videoState.isVideoOn ? 'Stop video' : 'Start video'}
      </button>
      {share.isSharing && <button onClick={() => void share.stopShare()}>Stop share</button>}
      {recording.canControlRecording && <button onClick={() => void recording.startRecording()}>Record</button>}
    </div>
  );
}
HookReturns
useZoomUIToolkitLive sessionState, audioState, videoState, deviceState, shareState, participantState, chatState, the effective sessionOptions, and the client. Read-only; safe to call outside the provider
useAudioControlleraudioState plus join, leave, mute, unmute, device switching, and noise suppression. canControlAudio doesn't check the connection
useVideoControllervideoState plus start, stop, switch camera, mirror, hardware acceleration, and virtual background. canControlVideo doesn't check the connection
useShareControllerisSharing, isSharingPaused, toggleShare, stopShare, pauseShare, resumeShare, changeSharePrivilege
useRecordingControllerrecordingStatus, canControlRecording (connected, cloud recording enabled, host or co-host), and start, stop, pause, resume
useThemeThe current 'light' or 'dark' theme

sessionState.connectionState moves from Closed to Connected, may go to Reconnecting and back, and ends in Closed (or Fail). When the connection changes to Reconnecting, Closed, or Fail, all state objects return to their initial values.