Back to the library

Glyph — send

Variant: Send

A paper plane that outlines itself and leaves. The hull's first and longest stroke runs wingtip to nose and the fold follows crease to nose, so the heading is stated twice before anything moves. Then a 144ms pull back of 1.5 units on each axis — anticipation, and one whole pixel at 16px, so the button gets a visible answer to the press — and a 336ms launch on the set's one accelerating curve, because leaving under your own power speeds up. The wind-up is what makes that ease-in defensible: the first frame after the press already moves. Wind-up and launch are nested groups, each carrying its own curve. The SVG's viewport is the clip, so the plane leaves the icon's box, not the page, and stays inside its button. Use it on send and submit buttons for messages, played once per press from the wind-up; the empty frame that follows is the "sent" state.

svgline-drawingiconcontrolloop

The source

A complete HTML document. Paste it into an empty .html file and it plays — no stylesheet, script, font, or image to fetch.

<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title>Glyph — send</title>
    <style>
      :root {
        /* Neutrals — fixed, never remixed. */
        --ivory: #faf9f5;
        --paper: #ffffff;
        --oat: #e3dacc;
        --slate: #141413;

        /* Knobs — the remix API. A knob exists iff declared here and used below. */
        --hue: 38.8;
        --lift: 0;
        --chroma: 1;
        --speed: 1;

        /* Accents — derived from the knobs with the family's offsets baked in,
           so one hue roll moves them together. Defaults reproduce the original hex. */
        --clay: oklch(calc(0.6724 + var(--lift)) calc(0.1308 * var(--chroma)) var(--hue));
        --clay-d: oklch(calc(0.5797 + var(--lift)) calc(0.127 * var(--chroma)) var(--hue));
        --olive: oklch(
          calc(0.6118 + var(--lift)) calc(0.0713 * var(--chroma)) calc(var(--hue) + 88.3)
        );
        --rust: oklch(
          calc(0.5408 + var(--lift)) calc(0.1357 * var(--chroma)) calc(var(--hue) - 10.3)
        );

        /* Clock — 2.4s: fold 816ms, hold 288ms, wind-up 144ms, launch 336ms,
           then an empty frame long enough to read as "gone". In product, play
           it once per press from the wind-up. */
        --cycle: 2.4s;
        --t: calc(var(--cycle) / var(--speed));

        --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
        --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
        /* The launch. Accelerating away is what leaving under your own power
           looks like; the wind-up before it is the frame that answers the press. */
        --ease-accent: cubic-bezier(0.4, 0, 0.9, 0.5);
      }

      * {
        box-sizing: border-box;
        margin: 0;
        padding: 0;
      }

      body {
        min-height: 100vh;
        display: grid;
        place-items: center;
        background: var(--ivory);
        font-family:
          system-ui,
          -apple-system,
          'Segoe UI',
          Roboto,
          sans-serif;
        color: var(--slate);
      }

      .demo {
        display: grid;
        justify-items: center;
        gap: clamp(14px, 5vmin, 28px);
      }

      /* The SVG's own viewport is the clip: the plane leaves the icon's box,
         not the page, which is also what keeps it inside the button. */
      .glyph {
        display: block;
        fill: none;
        stroke: currentColor;
        stroke-linecap: round;
        stroke-linejoin: round;
      }

      /* Two instances of the same file. The hero shows what the strokes do;
         the button shows whether it still reads at the size it will ship at.
         The 16px copy takes a 2-unit stroke so it survives the pixel grid —
         at the hero's 1.5 it would render under a pixel wide. */
      .hero {
        width: clamp(72px, 30vmin, 128px);
        height: auto;
        stroke-width: 1.5;
      }

      .button {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 8px 16px 8px 13px;
        border: 1px solid var(--oat);
        border-radius: 999px;
        background: var(--paper);
        color: inherit;
        font: inherit;
        font-size: 13px;
        font-weight: 500;
        line-height: 1;
        cursor: pointer;
      }

      .button .glyph {
        width: 16px;
        height: 16px;
        stroke-width: 2;
      }

      .hull,
      .fold {
        stroke-dasharray: 100 200;
        stroke-dashoffset: 100;
      }

      /* Curves sit on the element: Chromium ignores a var() timing function
         inside keyframes and falls back to plain ease. The wind-up and the
         launch want different curves, so they are two nested groups. */

      /* The hull's first and longest stroke runs wingtip to nose: the pen
         travels the way the plane will. The fold follows crease to nose, the
         same direction again, so the heading is stated twice before anything
         moves. */
      .hull {
        animation: hull var(--t) var(--ease-in-out) infinite;
      }

      .fold {
        animation: fold var(--t) var(--ease-out) infinite;
      }

      .plane {
        animation: windup var(--t) var(--ease-out) infinite;
      }

      .launch {
        animation: launch var(--t) var(--ease-accent) infinite;
      }

      @keyframes hull {
        0%,
        4% {
          stroke-dashoffset: 100;
        }
        32%,
        100% {
          stroke-dashoffset: 0;
        }
      }

      @keyframes fold {
        0%,
        28% {
          stroke-dashoffset: 100;
        }
        38%,
        100% {
          stroke-dashoffset: 0;
        }
      }

      /* A pull back of 1.5 units on each axis — one whole pixel in the 16px
         button, the least that still shows there. Anticipation is what makes
         the departure read as chosen rather than as the icon being yanked
         off the page, and it is the frame that answers the press. */
      @keyframes windup {
        0%,
        50% {
          transform: translate(0, 0);
        }
        56%,
        100% {
          transform: translate(-1.5px, 1.5px);
        }
      }

      @keyframes launch {
        0%,
        56% {
          transform: translate(0, 0);
        }
        70%,
        100% {
          transform: translate(16.5px, -16.5px);
        }
      }

      @media (prefers-reduced-motion: reduce) {
        /* No flight. The fold still draws in its heading, then the plane
           fades where it sits — sent, without travelling. */
        .launch {
          animation: none;
        }

        .hull,
        .fold {
          animation-duration: calc(var(--t) * 2);
        }

        .plane {
          animation: plane-fade calc(var(--t) * 2) var(--ease-out) infinite;
        }

        @keyframes plane-fade {
          0%,
          56% {
            opacity: 1;
          }
          70%,
          100% {
            opacity: 0;
          }
        }
      }
    </style>
  </head>
  <body>
    <div class="demo">
      <svg
        class="glyph hero"
        viewBox="0 0 24 24"
        role="img"
        aria-label="A send icon: a paper plane outlines itself from the wingtip toward the nose, draws back slightly, and launches out of frame up and to the right"
      >
        <g class="plane">
          <g class="launch">
            <path class="hull" pathLength="100" d="M3 10 L21 3 L14 21 L10.5 13.5 Z" />
            <path class="fold" pathLength="100" d="M10.5 13.5 L21 3" />
          </g>
        </g>
      </svg>

      <button class="button" type="button">
        <svg class="glyph" viewBox="0 0 24 24" aria-hidden="true">
          <g class="plane">
            <g class="launch">
              <path class="hull" pathLength="100" d="M3 10 L21 3 L14 21 L10.5 13.5 Z" />
              <path class="fold" pathLength="100" d="M10.5 13.5 L21 3" />
            </g>
          </g>
        </svg>
        Send
      </button>
    </div>
  </body>
</html>

The variant family

Same idea, one axis moved. Compare them side by side before you commit.