Components › Blocks
Poll card
A question to vote on; after voting it shows each option's share.
Installation
npx plankui@latest add poll-cardUsage
import { PollCard } from "@/components/ui/poll-card";
<PollCard question="What should we build next?" options={[{ id: "api", label: "Public API", votes: 22 }]} onVote={save} />API reference
| Prop | Type | Default | Description |
|---|---|---|---|
| question | string | required | What people vote on. |
| options | { id, label, votes }[] | required | The choices and their votes so far. |
| onVote | (id: string) => void | Called with the chosen option. | |
| voted | string | Show results at once, for someone who already voted. | |
| note | ReactNode | A line under the results. |