Poll
pollA question to vote on that turns into its results in place: bars grow to each share, the percentages roll and always total 100, and your choice is marked. Single or multiple choice, on real radios and checkboxes.
"use client";
import { Poll } from "@/components/forme/poll/poll";
export function PollDemo() {
return (
<div className="flex w-full flex-wrap items-start justify-center gap-6">
<Poll
question="What should we build next?"
description="One vote. The results show once you have voted."
options={[
{ id: "dark", label: "Scheduled dark mode", description: "Follow the time of day" },
{ id: "offline", label: "Offline drafts", description: "Write without a connection" },
{ id: "export", label: "CSV export", description: "Every table, one click" },
]}
votes={{ dark: 128, offline: 214, export: 96 }}
onVote={() => new Promise((resolve) => setTimeout(resolve, 600))}
/>
<Poll
multiple
question="Which integrations do you use?"
options={[
{ id: "slack", label: "Slack" },
{ id: "linear", label: "Linear" },
{ id: "github", label: "GitHub" },
{ id: "notion", label: "Notion" },
]}
votes={{ slack: 61, linear: 38, github: 77, notion: 24 }}
defaultValue={["github", "linear"]}
defaultVoted
/>
</div>
);
}Install
Adds the component, its registry dependencies, and the token stylesheet you import once.
API reference
Read from the source, so it is the API of the file you install. A prop marked * is required.
Poll
A question with a vote, and what everyone said.
| Prop | Type | Default | Description |
|---|---|---|---|
question* | ReactNode | — | |
options* | readonly PollOption[] | — | |
description | ReactNode | — | |
votes | Readonly<Record<string, number>> | {} | Everyone else's votes, by option id. The poll counts the person's own vote itself, so the bars move the moment they vote rather than after a round trip. |
multiple | boolean | false | Allow more than one choice: checkboxes instead of radios. |
defaultValue | readonly string[] | [] | The person's choice, for a poll they have already answered. |
defaultVoted | boolean | false | Start on the results: they voted in an earlier visit. |
showResults | boolean | false | Show the results before voting, too. |
onVote | (ids: string[]) => void | Promise<void> | — | Called with the chosen ids. Return a promise and the button waits for it. |
submitLabel | string | "Vote" | |
className | string | — |
Related


Checkbox
A single choice with a visible label wired to it for a screen reader. Carries a destructive variant for choices that cannot be undone, and the box itself fills with the accent when checked so the state is readable at a glance.
forms

Radio group
A choice of exactly one option, where the group owns the value and the arrow keys travel in the direction the options are laid out. Horizontal and vertical are the same component with an orientation, and a disabled option reads as present but unavailable.
forms

Select
A choice from a list too long for radio buttons. Grouped with labels, an inline check on the selected option, typeahead and arrow-key navigation from the Base UI select primitive, and a trigger that reads as a field rather than as a button so it sits beside inputs without looking wrong.
forms