Interactive · Gutenberg
Interactive Poll block for WordPress
Clickable voting poll with animated results stored per visitor.
Get Blockenberg
Free Gutenberg block in Blockenberg. The inspector controls and front-end behavior on this page come from this block’s source, not a shared stub.
What it actually does
Clickable voting poll with animated results stored per visitor.
Inspector panels on this block: Question, Poll Options, Behaviour, Layout. Those titles come from index.js, not from a shared template.
Where to find it
Gutenberg inserter → Interactive → search “Interactive Poll” (block name `blockenberg/interactive-poll` in block.json). Style it in the sidebar after insert.
How to use Interactive Poll block for WordPress
- Install Blockenberg. Install from WordPress.org and activate the plugin.
- Insert the block. Edit a page, click +, search for “Interactive Poll”, insert it. Category: Interactive.
- Configure inspector controls that exist on this block. Open Question. Set “Question text”, “Show total votes”, “Option text”, “Initial votes (for preview)”.
- Check the published page. The view script reads HTML data attributes: data-allow-revote, data-animate, data-index, data-instance, data-show-before. The block editor preview may not run the same view script.
Inspector controls from this block’s code
| Control | What the code does |
|---|---|
| Question text | Multiline text field in the inspector. block.json default: What is your favourite option?. Saved as `question`. |
| Show total votes | On/off toggle in the inspector. On by default. Saved as `totalVotesLabel`. |
| Option text | Text field in the inspector. |
| Initial votes (for preview) | Numeric range control in the inspector. Range 0–999. |
| Allow revoting | On/off toggle in the inspector. On by default. Saved as `allowRevote`. |
| Show results before voting | On/off toggle in the inspector. Off by default. Saved as `showResultsBefore`. |
| Animate result bars | On/off toggle in the inspector. On by default. Saved as `animateBars`. |
| Max width (px) | Numeric range control in the inspector. Range 240–900. block.json default: 560. Saved as `maxWidth`. |
| Padding (px) | Numeric range control in the inspector. Range 0–80. block.json default: 32. Saved as `wrapPadding`. |
| Border radius (px) | Numeric range control in the inspector. Range 0–40. block.json default: 10. Saved as `borderRadius`. |
| Bar fill color | Color control in the inspector. block.json default: #6c3fb5. Saved as `barColor`. |
| Bar track color | Color control in the inspector. block.json default: #ede9fe. Saved as `barBg`. |
| Button background | Color control in the inspector. block.json default: #6c3fb5. Saved as `buttonBg`. |
| Button text color | Color control in the inspector. block.json default: #ffffff. Saved as `buttonColor`. |
| Question color | Color control in the inspector. Saved as `questionColor`. |
| Result text color | Color control in the inspector. Saved as `resultTextColor`. |
| Card background | Color control in the inspector. Saved as `wrapBg`. |
| Card border color | Color control in the inspector. Saved as `wrapBorder`. |
What the front-end script actually does
- The view script reads HTML data attributes: data-allow-revote, data-animate, data-index, data-instance, data-show-before.
- It writes to localStorage in the visitor’s browser, not to wp_options.
- JavaScript functions that perform the math: calcTotals.
When this is the right block
- Clickable voting poll with animated results stored per visitor — that is the job of Interactive Poll, not a generic content block.
- Use it when you need the editor control labeled “Question text”, which exists on this block’s inspector.
- It matches pages about poll, vote, survey.
- The math runs in the visitor’s browser after publish — no extra calculator plugin.
Notes from the implementation
viewScript: this folder’s frontend.js is enqueued on the front end for this block.
FAQ
How do I add the Interactive Poll block in WordPress?
Install Blockenberg from WordPress.org, edit a page in the block editor, click +, and search for “Interactive Poll”. It sits under Interactive. After insert, open Question and set “Question text”, “Show total votes”, “Option text”, “Initial votes (for preview)”.
Does Interactive Poll need a server or extra plugin?
No. After Blockenberg is active, the view script runs in the browser with the values you saved on the block.
Is the Interactive Poll Gutenberg block free?
Yes. Interactive Poll ships inside Blockenberg. Get the plugin from WordPress.org — no paid add-on is required for this block.
Can I style Interactive Poll to match my theme?
Yes. Blockenberg’s shared typography and color panels apply here, plus any block-specific style controls listed on this page (panels: Question, Poll Options, Behaviour, Layout).
Related interactive blocks
Reaction Bar
Display emoji reaction counters (GitHub / Notion / Slack style) to show community sentiment on any content.
Flashcard
Interactive flashcard deck for studying. Click to flip cards, navigate with arrows or buttons, shuffle deck, mark cards as known, and track progress.
Knowledge Check
Quick quiz question with instant reveal — great for educational content, articles, and explainers.
Trivia Game
A timed multiple-choice trivia game with built-in questions across Science, History, Geography, and Pop Culture categories.
Word Scramble
Interactive word unscramble game with categories, hints, scoring, and timer. Multiple difficulty levels.
2048 Game
The classic sliding-tile 2048 puzzle. Swipe or use arrow keys to merge tiles and reach the 2048 tile.
Get Blockenberg
Install Blockenberg from WordPress.org, then insert Interactive Poll from the Gutenberg inserter.