Interactive · Gutenberg

2048 Game block for WordPress

The classic sliding-tile 2048 puzzle. Swipe or use arrow keys to merge tiles and reach the 2048 tile.

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

The classic sliding-tile 2048 puzzle. Swipe or use arrow keys to merge tiles and reach the 2048 tile.

Inspector panels on this block: Content, Board Settings. Those titles come from index.js, not from a shared template.

Where to find it

Gutenberg inserter → Interactive → search “2048 Game” (block name `blockenberg/2048-game` in block.json). Style it in the sidebar after insert.

How to use 2048 Game block for WordPress

  1. Install Blockenberg. Install from WordPress.org and activate the plugin.
  2. Insert the block. Edit a page, click +, search for “2048 Game”, insert it. Category: Interactive.
  3. Configure inspector controls that exist on this block. Open Content. Set “Board Size (px)”, “Tile Radius (px)”, “Grid Gap (px)”, “Show Score”.
  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
Board Size (px)Numeric range control in the inspector. Range 260–560. block.json default: 380. Saved as `boardSize`.
Tile Radius (px)Numeric range control in the inspector. Range 0–24. block.json default: 8. Saved as `tileRadius`.
Grid Gap (px)Numeric range control in the inspector. Range 4–20. block.json default: 10. Saved as `gridGap`.
Show ScoreOn/off toggle in the inspector. On by default. Saved as `showScore`.
Show Best ScoreOn/off toggle in the inspector. On by default. Saved as `showBestScore`.
Animate TilesOn/off toggle in the inspector. On by default. Saved as `animateTiles`.
Typography — TitleShared Blockenberg typography popover (family, size, weight, spacing). Saved as `titleTypo`.
SubtitleShared Blockenberg typography popover (family, size, weight, spacing). Saved as `subtitleTypo`.
Grid BackgroundColor control in the inspector. block.json default: #bbada0. Saved as `gridBg`.
Empty TileColor control in the inspector. block.json default: #cdc1b4. Saved as `tileBg`.
Section BackgroundColor control in the inspector. block.json default: #fef9ee. Saved as `sectionBg`.
Title / TextColor control in the inspector. block.json default: #776e65. Saved as `titleColor`.
Score HeaderColor control in the inspector. block.json default: #bbada0. Saved as `scoreHeaderBg`.
New Game ButtonColor control in the inspector. block.json default: #8f7a66. Saved as `newGameBg`.

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 2048 Game block in WordPress?

Install Blockenberg from WordPress.org, edit a page in the block editor, click +, and search for “2048 Game”. It sits under Interactive. After insert, open Content and set “Board Size (px)”, “Tile Radius (px)”, “Grid Gap (px)”, “Show Score”.

Does 2048 Game 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 2048 Game Gutenberg block free?

Yes. 2048 Game ships inside Blockenberg. Get the plugin from WordPress.org — no paid add-on is required for this block.

Can I style 2048 Game 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: Content, Board Settings).

Related interactive blocks

Get Blockenberg

Install Blockenberg from WordPress.org, then insert 2048 Game from the Gutenberg inserter.

Get Blockenberg