> ## Documentation Index
> Fetch the complete documentation index at: https://cometchat-22654f5b-docs-platform-docs-release.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Polls Plugin

> Renders poll messages with question, voting options, and real-time vote counts.

<Accordion title="AI Integration Quick Reference">
  | Field                | Value                                                                               |
  | -------------------- | ----------------------------------------------------------------------------------- |
  | Plugin ID            | `polls`                                                                             |
  | Package              | `@cometchat/chat-uikit-react`                                                       |
  | Message Types        | `extension_poll`                                                                    |
  | Message Categories   | `custom`                                                                            |
  | Included by Default  | Yes                                                                                 |
  | Bubble Component     | `CometChatPollBubble`                                                               |
  | Conversation Preview | Poll question text (truncated)                                                      |
  | Context Menu         | React, Reply, Reply in Thread, Info, Delete, Report, Mark Unread, Message Privately |
</Accordion>

## 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.

<Info>
  **Live Preview** — interact with the poll bubble.

  [Open in Storybook ↗](https://storybook.cometchat.io/react/?path=/story/components-bubbles-message-bubble--poll-message)
</Info>

<iframe src="https://storybook.cometchat.io/react/iframe.html?id=components-bubbles-message-bubble--poll-message&viewMode=story&shortcuts=false&singleStory=true" className="w-full rounded-xl" loading="lazy" style={{height: "550px", border: "1px solid #e0e0e0"}} title="Poll Bubble — Default" allow="clipboard-write" />

***

## 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`:

```json theme={null}
{
  "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

| Target       | Selector                             |
| ------------ | ------------------------------------ |
| 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` |
