Sticky mobile contact bar in WordPress
A bottom bar with Call, Directions and Free quote that tucks away while visitors read down the page and returns as soon as they scroll up. Built for tradespeople whose customers arrive on a phone.
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
The code in WordPress
<?php
/**
* Plugin Name: Forge, Barre de contact mobile fixe
* Description: Une barre en bas de l'écran avec « Appeler », « Itinéraire » et « Devis gratuit », qui se range quand on lit vers le bas et revient dès qu'on remonte. Pensée pour les artisans dont les clients arrivent depuis un téléphone. Ajoute la composition « Barre de contact mobile fixe » à 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-bouton-appel-flottant-barre-contact-mobile
*<!-- wp:group {"className": "bcm-page", "layout": {"type": "default"}} -->
<div class="wp-block-group bcm-page"><!-- wp:group {"tagName": "header", "className": "bcm-hero", "layout": {"type": "default"}} -->
<header class="wp-block-group bcm-hero"><!-- wp:paragraph {"className": "bcm-hero__kicker"} -->
<p class="bcm-hero__kicker">Couvreur zingueur à Angers</p>
<!-- /wp:paragraph -->
<!-- wp:heading {"level": 1} -->
<h1 class="wp-block-heading">Couverture Lemoine</h1>
<!-- /wp:heading -->
<!-- wp:paragraph {"className": "bcm-hero__intro"} -->
<p class="bcm-hero__intro">Ardoise, tuile et zinc dans tout le Maine-et-Loire depuis 2004. Une équipe de quatre compagnons, une garantie décennale et un interlocuteur unique du devis à la réception du chantier.</p>
<!-- /wp:paragraph --></header>
<!-- /wp:group -->(() => {
if (!document.querySelector(".bcm-page")) return;
// Hides the bar while the visitor reads downwards and brings it back as soon as they scroll up.
document.querySelectorAll("[data-bcm]").forEach((bar) => {
const reduced = window.matchMedia("(prefers-reduced-motion: reduce)");
let last = window.scrollY;
let ticking = false;
function show(visible) {
bar.dataset.state = visible ? "shown" : "hidden";
}
:root {
--bcm-text: #1c1917;
--bcm-body: #44403c;
--bcm-accent: #9a3412;
--bcm-accent-hover: #7c2d12;
--bcm-line: #e7e5e4;
--bcm-surface: #ffffff;
--bcm-shadow: 0 -6px 20px rgb(28 25 23 / 0.1);
--bcm-call-bg: #9a3412;
--bcm-call-hover: #7c2d12;
--bcm-call-text: #ffffff;
--bcm-ghost-text: #7c2d12;Free component: copy it freely, including for commercial projects.
Other breadcrumbs and pagination components in WordPress
Breadcrumbs and pagination components in WordPress
A slim bar at the top of the page with a message, a link and a close button; once closed, it stays hidden for the period you choose.
- Tailwind
- React
- CSS
- WordPress

A sticky sidebar table of contents for blog posts: it highlights the section being read, shows the reading time left and folds into a list under the title on mobile.
- Tailwind
- React
- CSS
- WordPress

A column of dots on the side of the page that follows the section being read and lets visitors jump to it, with a label on hover and focus.
- Tailwind
- React
- CSS
- WordPress

Step indicator
FreeAn order step indicator: finished steps clickable to go back, the current step announced, upcoming steps locked.
- Tailwind
- React
- CSS
- WordPress

Tooltips in four positions that open on hover, tap and keyboard focus, and close with Escape, as WCAG requires.
- Tailwind
- React
- CSS
- WordPress

Quick access links that appear on the first Tab press to skip the header and menu, as required by the RGAA and WCAG.
- Tailwind
- React
- CSS
- WordPress