Interactive · Gutenberg

Tetris Game block for WordPress

A fully playable Tetris game block. Supports keyboard and on-screen controls, levels, score, and rich style customization.

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

A fully playable Tetris game block. Supports keyboard and on-screen controls, levels, score, and rich style customization.

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

Where to find it

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

How to use Tetris 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 “Tetris Game”, insert it. Category: Interactive.
  3. Configure inspector controls that exist on this block. Open Content. Set “Starting Level”, “Show Ghost Piece”, “Show Next Piece”, “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
Starting LevelNumeric range control in the inspector. Range 1–15. block.json default: 1. Saved as `startLevel`.
Show Ghost PieceOn/off toggle in the inspector. On by default. Saved as `showGhost`.
Show Next PieceOn/off toggle in the inspector. On by default. Saved as `showNext`.
Show ScoreOn/off toggle in the inspector. On by default. Saved as `showScore`.
Show LevelOn/off toggle in the inspector. On by default. Saved as `showLevel`.
Show LinesOn/off toggle in the inspector. On by default. Saved as `showLines`.
Cell Size (px)Numeric range control in the inspector. Range 18–40. block.json default: 30. Saved as `cellSize`.
Section BackgroundColor control in the inspector. block.json default: #0f0e17. Saved as `sectionBg`.
UI BackgroundColor control in the inspector. block.json default: #0f0e17. Saved as `bgColor`.
Board BackgroundColor control in the inspector. block.json default: #1a1a2e. Saved as `boardBg`.
Grid LinesColor control in the inspector. block.json default: #16213e. Saved as `gridColor`.
Ghost PieceColor control in the inspector. block.json default: rgba(255,255,255,0.12). Saved as `ghostColor`.
Title / TextColor control in the inspector. block.json default: #fffffe. Saved as `titleColor`.
AccentColor control in the inspector. block.json default: #ff8906. Saved as `accentColor`.

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

Install Blockenberg from WordPress.org, edit a page in the block editor, click +, and search for “Tetris Game”. It sits under Interactive. After insert, open Content and set “Starting Level”, “Show Ghost Piece”, “Show Next Piece”, “Show Score”.

What makes Tetris Game different from other Blockenberg blocks?

A fully playable Tetris game block. Supports keyboard and on-screen controls, levels, score, and rich style customization. Inspector labels on this block include “Starting Level”, “Show Ghost Piece”, “Show Next Piece”, “Show Score”.

Is the Tetris Game Gutenberg block free?

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

Can I style Tetris 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, Game Settings).

Related interactive blocks

Get Blockenberg

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

Get Blockenberg