Const// Host creating and managing polls
<PollModal
isPollModalVisible={isOpen}
onClose={() => setIsOpen(false)}
member="host-user"
islevel="2"
polls={allPolls}
poll={activePoll}
socket={socket}
roomName="demo-room"
handleCreatePoll={handleCreatePoll}
handleEndPoll={handleEndPoll}
handleVotePoll={handleVotePoll}
updateIsPollModalVisible={setIsOpen}
/>
// Participant voting with custom styling
<PollModal
isPollModalVisible={visible}
onClose={onClose}
member={participantId}
islevel="0"
polls={pollHistory}
poll={currentPoll}
socket={socket}
roomName={roomName}
handleCreatePoll={handleCreatePoll}
handleEndPoll={handleEndPoll}
handleVotePoll={handleVotePoll}
updateIsPollModalVisible={setVisible}
backgroundColor="#eef6ff"
style={{ borderRadius: 20 }}
/>
// Supplying a custom container through uiOverrides
const overrides = {
pollModal: {
component: MyCustomPollModal,
injectedProps: {
theme: 'dark',
},
},
};
const PollModalComponent = withOverride(overrides.pollModal, PollModal);
<PollModalComponent
isPollModalVisible={visible}
onClose={onClose}
member="user-1"
islevel="1"
polls={polls}
poll={poll}
socket={socket}
roomName="lobby"
handleCreatePoll={handleCreatePoll}
handleEndPoll={handleEndPoll}
handleVotePoll={handleVotePoll}
updateIsPollModalVisible={setVisible}
/>
PollModal - Interactive polling and voting interface.
Provides a full polling workflow for MediaSFU rooms, enabling hosts to author polls, participants to vote, and everyone to view live results with percentages. Layout and container wrappers can be overridden through
uiOverrides.pollModalwhile retaining the built-in handlers.Key Features:
styleprop or render overrides.UI Customization: Replace via
uiOverrides.pollModalto supply an entirely custom polling UI while continuing to leverage the provided poll handlers.