Skip to main content

Documentation Index

Fetch the complete documentation index at: https://cometchat-22654f5b-react-uikit-v7.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

FieldValue
Plugin IDpolls
Package@cometchat/chat-uikit-react
Message Typesextension_poll
Message Categoriescustom
Included by DefaultYes
Bubble ComponentCometChatPollBubble
Conversation PreviewPoll question text (truncated)
Context MenuReact, Reply, Reply in Thread, Info, Delete, Report, Mark Unread, Message Privately

Overview

The Polls plugin handles messages of type extension_poll in category custom. It renders an interactive poll bubble where users can vote on options and see real-time results.

Bubble Rendering

  • Question — displayed as the poll title
  • Options — clickable vote buttons with option text
  • Results — percentage bars showing vote distribution after voting
  • Vote count — total number of votes
  • Lazy-loaded — the bubble component is not included in the initial bundle
The poll data is extracted from the message’s customData:
{
  "question": "What's for lunch?",
  "options": { "1": "Pizza", "2": "Sushi", "3": "Tacos" },
  "results": { "total": 5, "options": { "1": 3, "2": 1, "3": 1 }, "voters": {} }
}

Context Menu Options

Standard media options: React, Reply, Reply in Thread, Info, Delete, Report, Mark Unread, Message Privately.

Conversation Preview

Returns the poll question text (truncated to 80 characters). Falls back to Poll if no question is found.

CSS Selectors

TargetSelector
Bubble root.cometchat-poll-bubble
Question.cometchat-poll-bubble__question
Option.cometchat-poll-bubble__option
Progress bar.cometchat-poll-bubble__progress
Vote count.cometchat-poll-bubble__vote-count