Interactive · Gutenberg
Drawing Canvas block for WordPress
A fully interactive freehand drawing canvas with multiple tools, undo, and download — right in your page.
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
A fully interactive freehand drawing canvas with multiple tools, undo, and download — right in your page.
Inspector panels on this block: Block Content, Canvas Settings, Toolbar & UI. Those titles come from index.js, not from a shared template.
Behavior controls: “Default tool” options: ✏️ Pen (freehand), 🖊️ Marker (soft), 📏 Line, □ Rectangle, ○ Ellipse.
Where to find it
Gutenberg inserter → Interactive → search “Drawing Canvas” (block name `blockenberg/drawing-canvas` in block.json). Style it in the sidebar after insert.
How to use Drawing Canvas block for WordPress
- Install Blockenberg. Install from WordPress.org and activate the plugin.
- Insert the block. Edit a page, click +, search for “Drawing Canvas”, insert it. Category: Interactive.
- Configure inspector controls that exist on this block. Open Block Content. Set “Canvas width (px)”, “Canvas height (px)”, “Default stroke width”, “Default tool”.
- 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 |
|---|---|
| Canvas width (px) | Numeric range control in the inspector. Range 300–1600. block.json default: 800. Saved as `canvasWidth`. |
| Canvas height (px) | Numeric range control in the inspector. Range 200–1200. block.json default: 480. Saved as `canvasHeight`. |
| Default stroke width | Numeric range control in the inspector. Range 1–40. block.json default: 4. Saved as `defaultLineWidth`. |
| Default tool | Select control; the chosen value is saved on the block. Options: ✏️ Pen (freehand); 🖊️ Marker (soft); 📏 Line; □ Rectangle; ○ Ellipse; 🧹 Eraser. block.json default: pen. Saved as `defaultTool`. |
| Show background grid | On/off toggle in the inspector. Off by default. Saved as `showGrid`. |
| Show toolbar | On/off toggle in the inspector. On by default. Saved as `showToolbar`. |
| Show undo button | On/off toggle in the inspector. On by default. Saved as `showUndo`. |
| Show download button | On/off toggle in the inspector. On by default. Saved as `showDownload`. |
| 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`. |
| Accent color | Color control in the inspector. block.json default: #6366f1. Saved as `accentColor`. |
| Canvas background | Color control in the inspector. block.json default: #ffffff. Saved as `backgroundColor`. |
| Grid lines | Color control in the inspector. block.json default: #e5e7eb. Saved as `gridColor`. |
| Section background | Color control in the inspector. block.json default: #f8fafc. Saved as `sectionBg`. |
| Title color | Color control in the inspector. block.json default: #1e1b4b. Saved as `titleColor`. |
What the front-end script actually does
- The view script reads HTML data attributes: data-opts.
- Drawing happens on a canvas element after the page loads.
When this is the right block
- A fully interactive freehand drawing canvas with multiple tools, undo, and download — right in your page — that is the job of Drawing Canvas, not a generic content block.
- Use it when you need the editor control labeled “Canvas width (px)”, which exists on this block’s inspector.
- 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 Drawing Canvas block in WordPress?
Install Blockenberg from WordPress.org, edit a page in the block editor, click +, and search for “Drawing Canvas”. It sits under Interactive. After insert, open Block Content and set “Canvas width (px)”, “Canvas height (px)”, “Default stroke width”, “Default tool”.
What makes Drawing Canvas different from other Blockenberg blocks?
A fully interactive freehand drawing canvas with multiple tools, undo, and download — right in your page. Inspector labels on this block include “Canvas width (px)”, “Canvas height (px)”, “Default stroke width”, “Default tool”.
Is the Drawing Canvas Gutenberg block free?
Yes. Drawing Canvas ships inside Blockenberg. Get the plugin from WordPress.org — no paid add-on is required for this block.
Can I style Drawing Canvas 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: Block Content, Canvas Settings, Toolbar & UI).
Related interactive blocks
2048 Game
The classic sliding-tile 2048 puzzle. Swipe or use arrow keys to merge tiles and reach the 2048 tile.
Analog Clock
A beautiful live analog clock rendered with SVG. Fully customizable: clock style, timezone, colors, size, and optional date/time labels.
Bingo Card
Interactive 5×5 Bingo card with number calling, win detection, and celebration animations.
Content Score
Visual content or SEO scoring card with circular gauge, color-coded criteria rows, and overall grade.
Dice Roller
Interactive dice roller supporting d4, d6, d8, d10, d12, d20 and d100. Roll multiple dice, see individual results, totals, and past roll history.
Events Calendar
Monthly events calendar grid with clickable events, color-coded categories, and an optional event list.
Get Blockenberg
Install Blockenberg from WordPress.org, then insert Drawing Canvas from the Gutenberg inserter.