Skip to content

Documentation callouts in WordPress

Three callouts for technical documentation: note, tip and warning.

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

alertes-encarts-documentation.php
<?php
/**
 * Plugin Name: Forge, Encarts de documentation
 * Description: Trois encarts pour la documentation technique : note, astuce et avertissement. Ajoute la composition « Encarts de documentation » à 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-alertes-encarts-documentation
 *
pattern.html
<!-- wp:group {"className": "docs", "layout": {"type": "default"}} -->
<div class="wp-block-group docs"><!-- wp:html -->
<aside class="docs__item docs__item--note" aria-label="Note">
          <p class="docs__title"><svg aria-hidden="true" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="9"/><path d="M12 11v5M12 8h.01"/></svg>Note</p>
          <p>Les variables d'environnement sont lues au démarrage : redémarrez le serveur après chaque modification du fichier <code>.env</code>.</p>
        </aside>
<!-- /wp:html -->
<!-- wp:html -->
<aside class="docs__item docs__item--tip" aria-label="Astuce">
          <p class="docs__title"><svg aria-hidden="true" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 18h6M10 21h4M12 3a6 6 0 0 0-3.5 10.9c.6.5 1 1.2 1 2.1h5c0-.9.4-1.6 1-2.1A6 6 0 0 0 12 3Z"/></svg>Astuce</p>
          <p>Ajoutez l'option <code>--watch</code> pour recompiler automatiquement à chaque enregistrement.</p>
        </aside>
style.css
:root {
  --doc-text: #042f2e;
  --doc-note: #0f766e;
  --doc-note-bg: #f0fdfa;
  --doc-tip: #6d28d9;
  --doc-tip-bg: #f5f3ff;
  --doc-warn: #b45309;
  --doc-warn-bg: #fffbeb;
  --doc-code: rgb(0 0 0 / 0.07);
  --demo-alertes-encarts-documentation-bg: #ffffff;
  --demo-alertes-encarts-documentation-text: #042f2e;
}

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

Toasts and alerts components in WordPress
  • A banner that warns visitors when they lose the network and announces when it is back, using browser events, with no request.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • A bell with an unread badge that opens a notification panel: icons by type, read and unread items told apart, and a "Mark all as read" button.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • The four classic interface messages: information, success, warning and error.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • A notice warning of a scheduled service interruption, with date, time and impact.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • A dashed callout highlighting an offer and its code, with the end date.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • An announcement bar at the top of the page with a link and a button to close it.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
Documentation callouts in WordPress: free code | Forge