Components › Blocks

Poll card

A question to vote on; after voting it shows each option's share.

Installation

npx plankui@latest add poll-card

Usage

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

PropTypeDefaultDescription
questionstringrequiredWhat people vote on.
options{ id, label, votes }[]requiredThe choices and their votes so far.
onVote(id: string) => voidCalled with the chosen option.
votedstringShow results at once, for someone who already voted.
noteReactNodeA line under the results.

View the source on GitHub