Developers · Gutenberg

Color Swatch block for WordPress

Display a branded color palette as a grid of swatches with names, HEX, RGB, and usage notes.

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

Display a branded color palette as a grid of swatches with names, HEX, RGB, and usage notes.

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

Color Swatch has no render.php and no frontend.js. The saved Gutenberg HTML is what visitors see, plus Blockenberg layout/typography CSS.

Where to find it

Gutenberg inserter → Developers → search “Color Swatch” (block name `blockenberg/color-swatch` in block.json). Style it in the sidebar after insert.

How to use Color Swatch block for WordPress

  1. Install Blockenberg. Install from WordPress.org and activate the plugin.
  2. Insert the block. Edit a page, click +, search for “Color Swatch”, insert it. Category: Developers.
  3. Configure inspector controls that exist on this block. Open Settings. Set “Settings — Title”, “Show Title”, “Subtitle”, “Show Subtitle”.
  4. Publish. Save the page. Output is the saved block HTML; typography/colors follow Blockenberg shared panels.

Inspector controls from this block’s code

ControlWhat the code does
Settings — TitleText field in the inspector. block.json default: Brand Color Palette. Saved as `title`.
Show TitleOn/off toggle in the inspector. On by default. Saved as `showTitle`.
SubtitleText field in the inspector. block.json default: Official colors for all print and digital materials. Saved as `subtitle`.
Show SubtitleOn/off toggle in the inspector. On by default. Saved as `showSubtitle`.
ColumnsNumeric range control in the inspector. Range 1–8. block.json default: 4. Saved as `columns`.
Show NameOn/off toggle in the inspector. On by default. Saved as `showName`.
Show HEX/RGBOn/off toggle in the inspector. On by default. Saved as `showHex`.
Show UsageOn/off toggle in the inspector. On by default. Saved as `showUsage`.
Show TagOn/off toggle in the inspector. On by default. Saved as `showTag`.
Swatch HeightNumeric range control in the inspector. Range 40–200. block.json default: 100. Saved as `swatchHeight`.
Border RadiusNumeric range control in the inspector. Range 0–28. block.json default: 12. Saved as `borderRadius`.
Typography — TitleShared Blockenberg typography popover (family, size, weight, spacing). Saved as `typoTitle`.
LabelShared Blockenberg typography popover (family, size, weight, spacing). Saved as `typoLabel`.
Wrapper BGColor control in the inspector. block.json default: #ffffff. Saved as `bgColor`.
Card BGColor control in the inspector. block.json default: #f9fafb. Saved as `cardBg`.
Colors — BorderColor control in the inspector. block.json default: #e5e7eb. Saved as `borderColor`.
HeadingColor control in the inspector. block.json default: #111827. Saved as `headingColor`.
SubtitleColor control in the inspector. block.json default: #6b7280. Saved as `subtitleColor`.
NameColor control in the inspector. block.json default: #111827. Saved as `nameColor`.
Meta/HEXColor control in the inspector. block.json default: #6b7280. Saved as `metaColor`.
NameText field in the inspector.
TagText field in the inspector.
UsageText field in the inspector.

When this is the right block

Notes from the implementation

Static block: markup is saved in post content; no PHP render callback in this folder.

FAQ

How do I add the Color Swatch block in WordPress?

Install Blockenberg from WordPress.org, edit a page in the block editor, click +, and search for “Color Swatch”. It sits under Developers. After insert, open Settings and set “Settings — Title”, “Show Title”, “Subtitle”, “Show Subtitle”.

What makes Color Swatch different from other Blockenberg blocks?

Display a branded color palette as a grid of swatches with names, HEX, RGB, and usage notes. Inspector labels on this block include “Settings — Title”, “Show Title”, “Subtitle”, “Show Subtitle”.

Is the Color Swatch Gutenberg block free?

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

Can I style Color Swatch 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: Settings, Swatches).

Related developers blocks

Get Blockenberg

Install Blockenberg from WordPress.org, then insert Color Swatch from the Gutenberg inserter.

Get Blockenberg