---
title: "Poll Vote"
description: "A one-tap poll: your ring fills with a check, your bar leads a wave of bars to their shares, and the percentages and vote total count up."
category: "Micro Interactions"
publishedAt: "2026-11-16"
updatedAt: "2026-11-25"
documentation: "https://beui.dev/micro-interactions/poll-vote"
markdown: "https://beui.dev/micro-interactions/poll-vote.md"
license: "MIT"
---

# Poll Vote

> A one-tap poll: your ring fills with a check, your bar leads a wave of bars to their shares, and the percentages and vote total count up.

## Install

```bash
npx shadcn@latest add @beui/poll-vote
```

## Dependencies

- `clsx`
- `motion`
- `react`
- `tailwind-merge`

## Usage

```tsx
"use client";

import { PollVote } from "@/components/motion/poll-vote";

const OPTIONS = [
  { id: "springs", label: "Springs", votes: 42 },
  { id: "curves", label: "Easing curves", votes: 27 },
  { id: "both", label: "Both, it depends", votes: 31 },
];

export function PollVoteUsage() {
  return (
    <div className="w-72">
      <PollVote options={OPTIONS} />
    </div>
  );
}
```

## API Reference

### PollVote

| Prop | Type | Default | Required | Description |
| --- | --- | --- | --- | --- |
| `options` | `PollOption[]` | — | Yes | The choices, each with an id, label and vote count before the viewer's vote. |
| `value` | `string \| null` | — | No | The viewer's choice, or null before they vote. |
| `defaultValue` | `string \| null` | `null` | No | The initial choice when uncontrolled. Default: null |
| `onValueChange` | `((value: string \| null) => void)` | — | No | Called with the option id when the viewer votes or changes their vote. |
| `labels` | `Partial<{ poll: string; percent: string; voted: string; votes: string; }>` | — | No | Override any built-in string, e.g. for translation. |
| `sound` | `boolean` | `false` | No | Play a crisp select on a vote. Off by default; a `SoundProvider` can mute it app-wide. |
| `className` | `string` | — | No | Classes merged onto the root fieldset. |

## Types

### PollOption

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | Yes | Unique key for the choice, passed to `onValueChange` on a vote. |
| `label` | `string` | Yes | Text shown on the choice's row. |
| `votes` | `number` | Yes | Votes before the viewer's; their vote adds 1 to the share. |

## About Poll Vote

Poll Vote is a React poll built with Framer Motion. Before you vote it is a list of options with radio rings. One tap fills your ring with a pop and draws a check in it, fills your bar first and the rest after it in a wave, slides each percentage in as it counts up, and ticks the vote total over. Picking another option moves your vote: every bar shifts at once and the numbers count from their old shares to the new ones. Clearing the vote drains the bars quickly.

### When to use it

- A blog post, community or newsletter asks a quick question.
- A product page collects feedback with one tap.
- A team chooses between a few options.

### Accessibility

Each option is a button with aria-pressed; after voting its name includes its share, such as Springs, 43%. Your vote is announced in a polite live region. The vote total under the list is plain text. With reduced motion the bars and numbers jump to their values and the ring fades instead of popping.

### FAQ

**How are the percentages worked out?**

From each option's votes plus the viewer's own vote, out of the total, rounded to whole numbers.

**Can I reset it?**

Control it with value and set it back to null; the bars drain and the list is ready for a vote again.

## Source

- Registry detail: https://beui.dev/r/poll-vote
- Raw source: https://beui.dev/r/poll-vote/raw
- GitHub: https://github.com/starc007/ui-components
