> ## Documentation Index
> Fetch the complete documentation index at: https://developers.reintersect.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Poll

> A single or multiple choice poll with live counts from Reintersect. Votes can be anonymous, and the creator closes the poll to announce the winner.

> Reintersect apps are in developer preview. Names and limits can still change before general
> release.

When a group has to pick between options, such as where to eat on Friday, a poll collects votes and
shows live counts. The creator closes the poll to announce the winner.

```tsx src/app.ts theme={null}
import { createReintersectApp } from "@reintersect/sdk/app";
import { poll } from "@reintersect/sdk/recipes";

export const LunchPoll = poll({
  type: "lunch-poll",
  title: "Lunch poll",
  choices: ["pizza", "sushi", "salad"],
  choiceLabels: {
    pizza: "Pizza",
    sushi: "Sushi",
    salad: { label: "Salad", description: "The light one" },
  },
  anonymous: true,
});

export const app = createReintersectApp({ name: "Lunch" }).addBlock(LunchPoll);

export const fridayLunch = LunchPoll.insert({
  question: "Where do we eat on Friday?",
  closesAt: "2026-10-09T11:00:00Z",
});
```

## Factory options

| Option | Type | Description |
| - | - | - |
| `type` | `string` | The block type. |
| `choices` | `[string, ...string[]]` | The values members pick from, at most 20. |
| `choiceLabels` | `Record<choice, string \| { label; description? }>` | A label for every choice. |
| `anonymous` | `boolean` | Counts only; voters are never recorded. |
| `multiple` | `boolean` | Members may pick several choices. |
| `labels` | `Partial<PollLabels>` | `vote`, `close`, `confirmTitle`, `confirmBody`, `closes`, `closed`, `noVotes`, `won`, `tied`. |

## Props, state and actions

Props are `{ question, closesAt? }`. State is `{ closed, winners?, votes? }`, starting at
`{ closed: false }`. The vote itself is a [viewer input](/blocks/viewer-inputs) named `choice`, so
Reintersect stores picks and shows live counts.

| Action | Behaviour |
| - | - |
| `close` | Destructive. Reads the tallies, records the winners and the vote count, and marks the block final with a summary such as "Pizza won with 5 votes." |

The question is the block's title, so the choice group carries the shorter `vote` label ("Your
vote"). Only the member who added the poll sees Close poll, because the recipe puts
`audience="creator"` on its `Actions`.

Exported helpers: `choiceCounts`, `closePoll`, `pollOutcome`, `PollView`, `POLL_LABELS`,
`POLL_INITIAL_STATE`, `PollPropsSchema`, `PollStateSchema`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.