## Poll Builder (S—245)

Compose a poll: a question, 2–6 options to add, reorder and remove, multiple choice and duration, live preview.

- URL: https://sundaeui.dev/components/poll-builder
- Category: Forms & inputs · Art direction: Refined
- Access: Free (no account needed)
- Stack: React 18+, TypeScript, plain CSS; dependencies: none
- Install: `npx shadcn@latest add https://sundaeui.dev/r/poll-builder.json`
- Tags: form, social, survey, poll, options, composer

Enter on an option adds the next one; empty trailing options are ignored. Arrow buttons reorder; options can’t go below two.
Settings cover multiple answers and how long it runs. The preview shows exactly what voters will see.

### Usage

```tsx
import { PollBuilder } from '@/components/sundae/poll-builder'

<PollBuilder />
```

### Props

- `onPublish` (`(poll: { q: string; options: string[]; multi: boolean; hours: number }) => void`): Publish callback.
- `max` (`number`, default `6`): Max options.
- `fill` (`'dark' | 'light'`, default `'dark'`): Surface: dark or light.

### When to use

- Team chat, community posts, event planning.

### When not to use

- Long surveys with branching.

### Accessibility

- Each option input is labelled “Option 2”; move buttons name the option.
- Validation messages are tied to the publish button.
- Reduced motion removes the movement and keeps every state change.

### Keyboard

- Enter in an option: Add the next option
