AI SDK Agents
Full Stack AI Patterns
Complex AI Agents
Workflow Patterns
Tools + Artifacts
Which feature would you like next?
pnpm dlx shadcn@latest add https://cult-ui.com/r/choice-poll.json
Use ChoicePoll.Root with Header, Title, Description, Options (each Option with Indicator and Label), and Footer. Supports single or multiple selection, controlled or uncontrolled value, and optional results after voting.
import { ChoicePoll } from "@/registry/default/ui/choice-poll"
export default function Example() {
return (
<ChoicePoll.Root>
<ChoicePoll.Header>
<ChoicePoll.Title>Which feature matters most?</ChoicePoll.Title>
<ChoicePoll.Description>
Pick one option. Results are shown after you vote.
</ChoicePoll.Description>
</ChoicePoll.Header>
<ChoicePoll.Options>
<ChoicePoll.Option value="speed">
<ChoicePoll.Indicator />
<ChoicePoll.Label>Faster builds</ChoicePoll.Label>
</ChoicePoll.Option>
<ChoicePoll.Option value="dx">
<ChoicePoll.Indicator />
<ChoicePoll.Label>Better DX</ChoicePoll.Label>
</ChoicePoll.Option>
<ChoicePoll.Option value="docs">
<ChoicePoll.Indicator />
<ChoicePoll.Label>Clearer docs</ChoicePoll.Label>
</ChoicePoll.Option>
</ChoicePoll.Options>
<ChoicePoll.Footer />
</ChoicePoll.Root>
)
}Wire value / onValueChange and set showResults, hasVoted, and votes when the user submits to show results and "You voted".
import { useState } from "react"
import { ChoicePoll } from "@/registry/default/ui/choice-poll"
export default function Example() {
const [value, setValue] = useState<string | undefined>()
const [hasVoted, setHasVoted] = useState(false)
const votes = { speed: 42, dx: 28, docs: 30 }
return (
<ChoicePoll.Root
value={value}
onValueChange={setValue}
hasVoted={hasVoted}
showResults
votes={votes}
>
<ChoicePoll.Header>
<ChoicePoll.Title>Which feature matters most?</ChoicePoll.Title>
<ChoicePoll.Description>Pick one, then submit.</ChoicePoll.Description>
</ChoicePoll.Header>
<ChoicePoll.Options>
<ChoicePoll.Option value="speed">
<ChoicePoll.Indicator />
<ChoicePoll.Label>Faster builds</ChoicePoll.Label>
<ChoicePoll.Progress />
<ChoicePoll.Percentage />
</ChoicePoll.Option>
<ChoicePoll.Option value="dx">
<ChoicePoll.Indicator />
<ChoicePoll.Label>Better DX</ChoicePoll.Label>
<ChoicePoll.Progress />
<ChoicePoll.Percentage />
</ChoicePoll.Option>
<ChoicePoll.Option value="docs">
<ChoicePoll.Indicator />
<ChoicePoll.Label>Clearer docs</ChoicePoll.Label>
<ChoicePoll.Progress />
<ChoicePoll.Percentage />
</ChoicePoll.Option>
</ChoicePoll.Options>
<ChoicePoll.Footer />
{/* In real usage, a submit button would set hasVoted to true */}
</ChoicePoll.Root>
)
}multiplevalue / defaultValue and onValueChangeshowResults, votes, hasVoted for progress bars and "You voted"