Skip to content

Poll

The Poll component (ui:poll) renders a voting interface with visual result bars. Supports single and multiple selection modes.

Examples

View Glyph Markdown source
```ui:poll
title: Framework Poll
question: Which framework do you prefer?
options:
- React
- Vue
- Angular
- Svelte
```

Multiple selection

Set multiple: true to allow selecting more than one option.

View Glyph Markdown source
```ui:poll
question: Which languages do you use? (select all)
options:
- TypeScript
- JavaScript
- Python
- Rust
- Go
multiple: true
```

Hidden results

Set showResults: false to hide the result bars after voting.

View Glyph Markdown source
```ui:poll
question: What is your favorite color?
options:
- Red
- Blue
- Green
showResults: false
```

Properties

PropertyTypeRequiredDefaultDescription
questionstringYesThe poll question.
optionsstring[]Yes2 to 10 answer options.
multiplebooleanNofalseAllow multiple selections (checkboxes).
showResultsbooleanNotrueShow result bars after voting.
titlestringNoOptional heading above the poll.
markdownbooleanNofalseEnable inline markdown formatting (bold, italic, links, code) in text fields.

Markdown Support

Enable inline markdown formatting in the question and option labels:

View Glyph Markdown source
```ui:poll
question: "Which **JavaScript framework** do you prefer for *production* apps?"
options:
- "**React** (by [Meta](https://react.dev))"
- "**Vue** with `Composition API`"
- "**Svelte** — *compiler-based*"
- "[Angular](https://angular.io)"
markdown: true
```

Supported formatting: bold, italic, code, links

Learn more about markdown in components →

Interaction events

Event kind: poll-vote

Payload fieldTypeDescription
selectedOptionsstring[]The text of selected options.
selectedIndicesnumber[]0-based indices of selected options.

Accessibility

  • Options use role="group" with radio buttons (single) or checkboxes (multiple).
  • Result bars use role="progressbar" with aria-valuenow.
  • Results area uses aria-live="polite" for screen reader announcements.
  • The outer container uses role="region" with aria-label.