Skip to content

Bento with counter cells and sparklines in WordPress

A six-cell bento grid: key figures, SVG sparklines, a quote and icons. All the text is in the HTML and the animation is CSS only, with no script at all.

Here is an excerpt of this component's code in WordPress. The full code is free for members, ready to copy into your project.

This component also comes in

Open in a new tab

The code in WordPress

features-bento-metriques-animees.php
<?php
/**
 * Plugin Name: Forge, Bento avec cellules à compteur et mini-graphique
 * Description: Une grille bento de six cellules : chiffres clés, mini-courbes SVG, citation et icônes. Tout le texte est dans le HTML, l'animation est en CSS seul, sans aucun script. Ajoute la composition « Bento avec cellules à compteur et mini-graphique » à l'éditeur de blocs.
 * Version: 1.0.0
 * Requires at least: 6.6
 * Requires PHP: 8.1
 * Author: Forge
 * License: GPL-2.0-or-later
 * License URI: https://www.gnu.org/licenses/gpl-2.0.html
 * Text Domain: forge-features-bento-metriques-animees
 *
pattern.html
<!-- wp:group {"tagName": "section", "className": "fbm", "layout": {"type": "default"}} -->
<section class="wp-block-group fbm"><!-- wp:group {"tagName": "header", "className": "fbm__head", "layout": {"type": "default"}} -->
<header class="wp-block-group fbm__head"><!-- wp:paragraph {"className": "fbm__kicker"} -->
<p class="fbm__kicker">Chauffage Lemoine, en chiffres</p>
<!-- /wp:paragraph -->
<!-- wp:heading {"level": 2, "className": "fbm__title", "anchor": "fbm-titre"} -->
<h2 class="wp-block-heading fbm__title" id="fbm-titre">Une chaudière entretenue, c’est un hiver sans mauvaise surprise</h2>
<!-- /wp:heading --></header>
<!-- /wp:group -->
<!-- wp:html -->
<ul class="fbm__grid" role="list">
          <li class="fbm__cell fbm__cell--main">
style.css
:root {
  --fbm-bg: #f6f1ec;
  --fbm-paper: #ffffff;
  --fbm-text: #2a1d16;
  --fbm-muted: #5f5047;
  --fbm-line: #e6dcd3;
  --fbm-accent: #b4431a;
  --fbm-on: #ffffff;
  --fbm-tint: #fdf1e8;
  --demo-features-bento-metriques-animees-bg: #ffffff;
  --demo-features-bento-metriques-animees-text: #2a1d16;
}

Free component: copy it freely, including for commercial projects.

Features components in WordPress
  • Three cards in saturated flat colours (yellow, pink, electric blue) with high-contrast text and a dark variant. Every colour pair is measured at AA: 5.5:1 at worst.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • Six features as frosted glass cards over a slowly drifting aurora mesh gradient. Pause button, still background under prefers-reduced-motion, CSS and a light script.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • The key message stays pinned while the background changes colour and illustration at each scroll step. CSS sticky, a light script, stacked cards as fallback under prefers-reduced-motion.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • A two-offer table: checked rows, a column highlighted from top to bottom and one call-to-action button per offer. Pure HTML and CSS, no script at all.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • A magazine-style article: title band, standfirst, drop cap, subheadings and a pull quote, set in three columns of equal height. Pure CSS, no script at all.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • A simulator that estimates the heating bill and the yearly savings in euros from the floor area, current energy and chosen works.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component