Skip to content

Submitting button in HTML and CSS

A button's state while a form is submitting: a small spinner and a "Sending" label.

Here is an excerpt of this component's code in HTML and CSS. 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 HTML and CSS

index.html
<!doctype html>
<html lang="fr">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title>Bouton en cours d'envoi</title>
    <link rel="stylesheet" href="style.css" />
  </head>
  <body>
    <main class="demo">
      <div class="sending">
        <button type="button" aria-disabled="true">
style.css
:root {
  --sd-btn: #15803d;
  --sd-btn-text: #ffffff;
  --sd-text: #3d5c48;
  --sd-ring: #14532d;
  --demo-bg: #f0fdf4;
  --demo-text: #052e16;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --sd-btn: #86efac;

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

Loaders components in HTML and CSS
  • Three dots bouncing one after another, for a short wait or a message being typed.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • A thin bar where a segment slides continuously, for a load of unknown duration.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • A spinning ring with a colored segment, alongside a loading text.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component