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.

Get Blockenberg

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

  1. Install Blockenberg. Install from WordPress.org and activate the plugin.
  2. Insert the block. Edit a page, click +, search for “Dice Roller”, insert it. Category: Interactive.
  3. Configure inspector controls that exist on this block. Open Dice Settings. Set “Default die type”, “Default die count”, “History shown”, “Show title”.
  4. 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

ControlWhat the code does
Default die typeSelect control; the chosen value is saved on the block. block.json default: d6. Saved as `defaultDie`.
Default die countNumeric range control in the inspector. Range 1–10. block.json default: 2. Saved as `defaultCount`.
History shownNumeric range control in the inspector. Range 3–20. block.json default: 8. Saved as `historySize`.
Show titleOn/off toggle in the inspector. On by default. Saved as `showTitle`.
Show subtitleOn/off toggle in the inspector. On by default. Saved as `showSubtitle`.
Show totalOn/off toggle in the inspector. On by default. Saved as `showTotal`.
Show modifierOn/off toggle in the inspector. On by default. Saved as `showModifier`.
Show roll historyOn/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 — TitleShared Blockenberg typography popover (family, size, weight, spacing). Saved as `typoTitle`.
SubtitleShared Blockenberg typography popover (family, size, weight, spacing). Saved as `typoSubtitle`.

What the front-end script actually does

When this is the right block

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

Get Blockenberg

Install Blockenberg from WordPress.org, then insert Dice Roller from the Gutenberg inserter.

Get Blockenberg