Interactive · Gutenberg

Tic-Tac-Toe block for WordPress

Playable Tic-Tac-Toe game with AI opponent, score tracking, custom symbols, and multiple difficulty modes.

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

Playable Tic-Tac-Toe game with AI opponent, score tracking, custom symbols, and multiple difficulty modes.

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

Behavior controls: “Default Mode” options: 🤖 Player vs AI, 👥 Player vs Player; “AI Difficulty” options: Easy (random), Medium (smart), Hard (minimax).

Where to find it

Gutenberg inserter → Interactive → search “Tic-Tac-Toe” (block name `blockenberg/tic-tac-toe` in block.json). Style it in the sidebar after insert.

How to use Tic-Tac-Toe block for WordPress

  1. Install Blockenberg. Install from WordPress.org and activate the plugin.
  2. Insert the block. Edit a page, click +, search for “Tic-Tac-Toe”, insert it. Category: Interactive.
  3. Configure inspector controls that exist on this block. Open Content. Set “Show Title”, “Show Subtitle”, “Show Score”, “Default Mode”.
  4. Check the published page. The view script reads HTML data attributes: data-opts, data-uid. The block editor preview may not run the same view script.

Inspector controls from this block’s code

ControlWhat the code does
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 ScoreOn/off toggle in the inspector. On by default. Saved as `showScore`.
Default ModeSelect control; the chosen value is saved on the block. Options: 🤖 Player vs AI; 👥 Player vs Player. block.json default: ai. Saved as `defaultMode`.
AI DifficultySelect control; the chosen value is saved on the block. Options: Easy (random); Medium (smart); Hard (minimax). block.json default: hard. Saved as `aiDifficulty`.
Player SymbolText field in the inspector. block.json default: X. Saved as `playerSymbol`.
AI / P2 SymbolText field in the inspector. block.json default: O. Saved as `aiSymbol`.
Max Width (px)Numeric range control in the inspector. Range 300–800. block.json default: 480. Saved as `contentMaxWidth`.
Accent ColorColor control in the inspector. block.json default: #6366f1. Saved as `accentColor`.
X Symbol ColorColor control in the inspector. block.json default: #ef4444. Saved as `xColor`.
O Symbol ColorColor control in the inspector. block.json default: #3b82f6. Saved as `oColor`.
Cell BackgroundColor control in the inspector. block.json default: #ffffff. Saved as `cellBg`.
Win Line ColorColor control in the inspector. block.json default: #22c55e. Saved as `winLineBg`.
Grid LinesColor control in the inspector. block.json default: #d1d5db. Saved as `gridLine`.
Section BackgroundColor control in the inspector. block.json default: #eef2ff. Saved as `sectionBg`.
Card BackgroundColor control in the inspector. block.json default: #ffffff. Saved as `cardBg`.
Title ColorColor control in the inspector. block.json default: #312e81. Saved as `titleColor`.

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 Tic-Tac-Toe block in WordPress?

Install Blockenberg from WordPress.org, edit a page in the block editor, click +, and search for “Tic-Tac-Toe”. It sits under Interactive. After insert, open Content and set “Show Title”, “Show Subtitle”, “Show Score”, “Default Mode”.

Does Tic-Tac-Toe 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 Tic-Tac-Toe Gutenberg block free?

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

Can I style Tic-Tac-Toe 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 Tic-Tac-Toe from the Gutenberg inserter.

Get Blockenberg