Hiyve Components - v1.0.0
    Preparing search index...
    • PollsWindow provides an interactive polling interface for video rooms.

      Parameters

      Returns ReactElement

      The rendered PollsWindow component

      PollsWindow automatically connects to the HiyveProvider context for room info and real-time synchronization. It must be used inside a <HiyveProvider>.

      Key Features:

      • Real-time poll creation and synchronization
      • Multiple poll types (multiple choice, yes/no, rating, text)
      • Voting with duplicate prevention
      • Owner-only poll management
      • Timer-based auto-end polls
      • Results sharing
      • Poll history with results viewing
      • Full customization via labels, icons, colors, styles, and render props

      User Roles:

      • Participants: Can vote on active polls
      • Owner/Host: Can create, start, end, and delete polls

      Basic usage inside HiyveProvider:

      import { HiyveProvider } from '@hiyve/react';
      import { PollsWindow } from '@hiyve/react-collaboration';

      function VideoRoom() {
      return (
      <HiyveProvider generateRoomToken={generateToken}>
      <div className="room-layout">
      <VideoGrid />
      <aside className="sidebar">
      <PollsWindow title="Polls" maxHeight={500} />
      </aside>
      </div>
      </HiyveProvider>
      );
      }

      With customization:

      <PollsWindow
      title="Live Polls"
      labels={{
      createPoll: 'New Poll',
      emptyState: 'No polls yet. Create one!',
      }}
      colors={{
      primaryAction: '#ff9800',
      }}
      onPollCreated={(poll) => console.log('New poll:', poll.question)}
      />