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.
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
- Install Blockenberg. Install from WordPress.org and activate the plugin.
- Insert the block. Edit a page, click +, search for “Metric Cards”, insert it. Category: Business.
- Configure inspector controls that exist on this block. Open Layout. Set “Columns”, “Card style”, “Gap (px)”, “Card radius (px)”.
- 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
| Control | What the code does |
|---|---|
| Columns | Select control; the chosen value is saved on the block. Options: 2 columns; 3 columns; 4 columns. block.json default: 4. Saved as `columns`. |
| Card style | Select 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 icon | On/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 sparkline | On/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 trend | On/off toggle in the inspector. On by default. Saved as `showTrend`. |
| Show trend period | On/off toggle in the inspector. On by default. Saved as `showTrendPeriod`. |
| Trend up | Color control in the inspector. block.json default: #10b981. Saved as `upColor`. |
| Trend down | Color control in the inspector. block.json default: #ef4444. Saved as `downColor`. |
| Card background | Color control in the inspector. block.json default: #ffffff. Saved as `globalCardBg`. |
| Card text | Color control in the inspector. block.json default: #111827. Saved as `globalTextColor`. |
| Label color | Color control in the inspector. block.json default: #6b7280. Saved as `labelColor`. |
| Section background | Color 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`. |
| Label | Text field in the inspector. |
| Value | Text field in the inspector. |
| Trend direction | Select 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 — Icon | Select 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 / Sparkline | Color control in the inspector. |
| Card Colors — Background | Color control in the inspector. |
| Card Colors — Text | Color control in the inspector. |
What the front-end script actually does
- An IntersectionObserver starts work when the block enters the viewport.
When this is the right block
- 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 — that is the job of Metric Cards, not a generic content block.
- Use it when you need the editor control labeled “Columns”, which exists on this block’s inspector.
- It matches pages about metrics, kpi, dashboard.
- Inserter grouping: company, service, and operations pages.
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
KPI Tiles
Metric tiles grid with numbers, labels, trend indicators and mini sparkline charts.
Stats Section
A landing-page statistics section — large numbers with labels, icons, optional section heading, and multiple layout/style variants.
Social Stats
Social media platform stats — display follower counts, subscriber milestones and engagement metrics with platform-branded icons (Instagram, YouTube, TikTok, LinkedIn, X/Twitter, Facebook, Pinterest).
Case Study
Client case study section with logo, challenge, solution, quantified before/after metrics and a pull quote. Perfect for agency, SaaS and consulting landing pages.
Stats Counter
Display animated number counters with icons, labels, and rich customization.
About Section
Ready-made About Us section with split image/video + text layout, optional company stats row, badge label, CTA buttons, and full background/color controls.
Get Blockenberg
Install Blockenberg from WordPress.org, then insert Metric Cards from the Gutenberg inserter.