Interactive · Gutenberg
Dice Roller block for WordPress
Interactive dice roller supporting d4, d6, d8, d10, d12, d20 and d100. Roll multiple dice, see individual results, totals, and past roll history.
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
Interactive dice roller supporting d4, d6, d8, d10, d12, d20 and d100. Roll multiple dice, see individual results, totals, and past roll history.
Inspector panels on this block: Dice Settings, Sizing. Those titles come from index.js, not from a shared template.
Where to find it
Gutenberg inserter → Interactive → search “Dice Roller” (block name `blockenberg/dice-roller` in block.json). Style it in the sidebar after insert.
How to use Dice Roller block for WordPress
- Install Blockenberg. Install from WordPress.org and activate the plugin.
- Insert the block. Edit a page, click +, search for “Dice Roller”, insert it. Category: Interactive.
- Configure inspector controls that exist on this block. Open Dice Settings. Set “Default die type”, “Default die count”, “History shown”, “Show title”.
- Check the published page. The view script reads HTML data attributes: data-opts. The block editor preview may not run the same view script.
Inspector controls from this block’s code
| Control | What the code does |
|---|---|
| Default die type | Select control; the chosen value is saved on the block. block.json default: d6. Saved as `defaultDie`. |
| Default die count | Numeric range control in the inspector. Range 1–10. block.json default: 2. Saved as `defaultCount`. |
| History shown | Numeric range control in the inspector. Range 3–20. block.json default: 8. Saved as `historySize`. |
| Show title | On/off toggle in the inspector. On by default. Saved as `showTitle`. |
| Show subtitle | On/off toggle in the inspector. On by default. Saved as `showSubtitle`. |
| Show total | On/off toggle in the inspector. On by default. Saved as `showTotal`. |
| Show modifier | On/off toggle in the inspector. On by default. Saved as `showModifier`. |
| Show roll history | On/off toggle in the inspector. On by default. Saved as `showHistory`. |
| Max width (px) | Numeric range control in the inspector. Range 320–900. block.json default: 580. Saved as `contentMaxWidth`. |
| Typography — Title | Shared Blockenberg typography popover (family, size, weight, spacing). Saved as `typoTitle`. |
| Subtitle | Shared Blockenberg typography popover (family, size, weight, spacing). Saved as `typoSubtitle`. |
What the front-end script actually does
- The view script reads HTML data attributes: data-opts.
When this is the right block
- Interactive dice roller supporting d4, d6, d8, d10, d12, d20 and d100. Roll multiple dice, see individual results, totals, and past roll history — that is the job of Dice Roller, not a generic content block.
- Use it when you need the editor control labeled “Default die type”, which exists on this block’s inspector.
- It matches pages about dice, roller, random.
- Inserter grouping: quizzes, games, and click-to-reveal experiences.
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 Dice Roller block in WordPress?
Install Blockenberg from WordPress.org, edit a page in the block editor, click +, and search for “Dice Roller”. It sits under Interactive. After insert, open Dice Settings and set “Default die type”, “Default die count”, “History shown”, “Show title”.
What makes Dice Roller different from other Blockenberg blocks?
Interactive dice roller supporting d4, d6, d8, d10, d12, d20 and d100. Roll multiple dice, see individual results, totals, and past roll history. Inspector labels on this block include “Default die type”, “Default die count”, “History shown”, “Show title”.
Is the Dice Roller Gutenberg block free?
Yes. Dice Roller ships inside Blockenberg. Get the plugin from WordPress.org — no paid add-on is required for this block.
Can I style Dice Roller 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: Dice Settings, Sizing).
Related interactive blocks
2048 Game
The classic sliding-tile 2048 puzzle. Swipe or use arrow keys to merge tiles and reach the 2048 tile.
Bingo Card
Interactive 5×5 Bingo card with number calling, win detection, and celebration animations.
Memory Game
Interactive card-flip memory matching game with emoji themes, difficulty levels, move counter, timer, and best score tracking.
Random Picker
Enter a list of items and pick a random winner with an animated highlight effect.
Snake Game
Classic Snake game playable in the browser. Keyboard and on-screen touch controls, high-score tracking, multiple speed levels and color themes.
Spin Wheel
An animated fortune-wheel random picker. Enter items, spin the wheel, and let it decide!
Get Blockenberg
Install Blockenberg from WordPress.org, then insert Dice Roller from the Gutenberg inserter.