Business · Gutenberg

Metric Cards block for WordPress

KPI / dashboard metric cards with trend indicators (up/down arrow + percentage change) and an optional mini sparkline. Different from Stats Counter — these show change-over-time context.

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

KPI / dashboard metric cards with trend indicators (up/down arrow + percentage change) and an optional mini sparkline. Different from Stats Counter — these show change-over-time context.

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

Behavior controls: “Columns” options: 2 columns, 3 columns, 4 columns; “Card style” options: Shadow, Glass, Flat; “Trend direction” options: Up (positive), Down (negative), Neutral; “Metrics — Icon” options: Bar chart, Users, Shield, Clock, Lightning.

Where to find it

Gutenberg inserter → Business → search “Metric Cards” (block name `blockenberg/metric-cards` in block.json). Style it in the sidebar after insert.

How to use Metric Cards 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 Cards”, insert it. Category: Business.
  3. Configure inspector controls that exist on this block. Open Layout. Set “Columns”, “Card style”, “Gap (px)”, “Card radius (px)”.
  4. Check the published page. An IntersectionObserver starts work when the block enters the viewport. The block editor preview may not run the same view script.

Inspector controls from this block’s code

ControlWhat the code does
ColumnsSelect control; the chosen value is saved on the block. Options: 2 columns; 3 columns; 4 columns. block.json default: 4. Saved as `columns`.
Card styleSelect control; the chosen value is saved on the block. Options: Shadow; Glass; Flat. block.json default: shadow. Saved as `cardStyle`.
Gap (px)Numeric range control in the inspector. Range 8–60. block.json default: 20. Saved as `gap`.
Card radius (px)Numeric range control in the inspector. Range 0–32. block.json default: 14. Saved as `cardRadius`.
Card padding (px)Numeric range control in the inspector. Range 8–64. block.json default: 24. Saved as `cardPadding`.
Show iconOn/off toggle in the inspector. On by default. Saved as `showIcon`.
Icon size (px)Numeric range control in the inspector. Range 16–48. block.json default: 20. Saved as `iconSize`.
Show sparklineOn/off toggle in the inspector. On by default. Saved as `showSparkline`.
Sparkline height (px)Numeric range control in the inspector. Range 16–80. block.json default: 40. Saved as `sparklineHeight`.
Show trendOn/off toggle in the inspector. On by default. Saved as `showTrend`.
Show trend periodOn/off toggle in the inspector. On by default. Saved as `showTrendPeriod`.
Trend upColor control in the inspector. block.json default: #10b981. Saved as `upColor`.
Trend downColor control in the inspector. block.json default: #ef4444. Saved as `downColor`.
Card backgroundColor control in the inspector. block.json default: #ffffff. Saved as `globalCardBg`.
Card textColor control in the inspector. block.json default: #111827. Saved as `globalTextColor`.
Label colorColor control in the inspector. block.json default: #6b7280. Saved as `labelColor`.
Section backgroundColor control in the inspector. Saved as `bgColor`.
Padding top (px)Numeric range control in the inspector. Range 0–200. block.json default: 32. Saved as `paddingTop`.
Padding bottom (px)Numeric range control in the inspector. Range 0–200. block.json default: 32. Saved as `paddingBottom`.
LabelText field in the inspector.
ValueText field in the inspector.
Trend directionSelect control; the chosen value is saved on the block. Options: Up (positive); Down (negative); Neutral.
Trend value (e.g. +12%)Text field in the inspector.
Trend period (e.g. vs last month)Text field in the inspector.
Metrics — IconSelect control; the chosen value is saved on the block. Options: Bar chart; Users; Shield; Clock; Lightning; Heart; Star; Dollar.
Sparkline data (comma-separated numbers)Text field in the inspector.
Accent / SparklineColor control in the inspector.
Card Colors — BackgroundColor control in the inspector.
Card Colors — TextColor control in the inspector.

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 Metric Cards block in WordPress?

Install Blockenberg from WordPress.org, edit a page in the block editor, click +, and search for “Metric Cards”. It sits under Business. After insert, open Layout and set “Columns”, “Card style”, “Gap (px)”, “Card radius (px)”.

What makes Metric Cards different from other Blockenberg blocks?

KPI / dashboard metric cards with trend indicators (up/down arrow + percentage change) and an optional mini sparkline. Different from Stats Counter — these show change-over-time context. Inspector labels on this block include “Columns”, “Card style”, “Gap (px)”, “Card radius (px)”.

Is the Metric Cards Gutenberg block free?

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

Can I style Metric Cards 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: Layout, Display, Metrics, Card Colors).

Related business blocks

Get Blockenberg

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

Get Blockenberg