Charts · Gutenberg

Metric Comparison block for WordPress

Before/after KPI comparison cards with change arrows and color-coded indicators.

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

Before/after KPI comparison cards with change arrows and color-coded indicators.

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

Behavior controls: “Format” options: Number, Currency, Percent.

Metric Comparison 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 → Charts → search “Metric Comparison” (block name `blockenberg/metric-comparison` in block.json). Style it in the sidebar after insert.

How to use Metric Comparison block for WordPress

  1. Install Blockenberg. Install from WordPress.org and activate the plugin.
  2. Insert the block. Edit a page, click +, search for “Metric Comparison”, insert it. Category: Charts.
  3. Configure inspector controls that exist on this block. Open Settings. Set “Settings — Title”, “Show Title”, “Before Label”, “After Label”.
  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: Q3 vs Q4 Performance. Saved as `title`.
Show TitleOn/off toggle in the inspector. On by default. Saved as `showTitle`.
Before LabelText field in the inspector. block.json default: Q3. Saved as `beforeLabel`.
After LabelText field in the inspector. block.json default: Q4. Saved as `afterLabel`.
ColumnsNumeric range control in the inspector. Range 1–6. block.json default: 3. Saved as `columns`.
Show ChangeOn/off toggle in the inspector. On by default. Saved as `showChange`.
Show ArrowsOn/off toggle in the inspector. On by default. Saved as `showArrows`.
Show BarOn/off toggle in the inspector. On by default. Saved as `showBar`.
Border RadiusNumeric range control in the inspector. Range 0–30. block.json default: 12. Saved as `borderRadius`.
Card Style — PaddingNumeric range control in the inspector. Range 8–48. block.json default: 20. Saved as `cardPadding`.
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`.
PositiveColor control in the inspector. block.json default: #10b981. Saved as `posColor`.
NegativeColor control in the inspector. block.json default: #ef4444. Saved as `negColor`.
NeutralColor control in the inspector. block.json default: #6b7280. Saved as `neutralColor`.
Colors — TitleColor control in the inspector. block.json default: #111827. Saved as `titleColor`.
Value TextColor control in the inspector. block.json default: #111827. Saved as `textColor`.
LabelsColor control in the inspector. block.json default: #6b7280. Saved as `labelColor`.
LabelText field in the inspector.
UnitText field in the inspector.
FormatSelect control; the chosen value is saved on the block. Options: Number; Currency; Percent.
Higher is betterOn/off toggle 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 Metric Comparison block in WordPress?

Install Blockenberg from WordPress.org, edit a page in the block editor, click +, and search for “Metric Comparison”. It sits under Charts. After insert, open Settings and set “Settings — Title”, “Show Title”, “Before Label”, “After Label”.

What makes Metric Comparison different from other Blockenberg blocks?

Before/after KPI comparison cards with change arrows and color-coded indicators. Inspector labels on this block include “Settings — Title”, “Show Title”, “Before Label”, “After Label”.

Is the Metric Comparison Gutenberg block free?

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

Can I style Metric Comparison 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, Card Style, Metrics).

Related charts blocks

Get Blockenberg

Install Blockenberg from WordPress.org, then insert Metric Comparison from the Gutenberg inserter.

Get Blockenberg