All effectsPlay & loop

Circular Text

环形绕字

Evenly spaced letters follow a circular path around a center mark and rotate as a ring.

Play the demo to rotate the lettering

Where to use it

Set short phrases around a badge, record sleeve, or brand seal. Set a short phrase around a generous radius and check the spacing where the beginning meets the end.

Practical example

A record label puts its name around a circular sleeve illustration. The lettering rotates slowly around a stationary center mark.

Also called

  • Text on a Circle
  • Curved Text

AI prompt

Set [short phrase] as Circular Text on a ring around [badge or image]. Keep letter spacing even, and rotate the ring slowly. Pause rotation for reduced motion and keep the circular layout.

Example code

Save the standalone HTML as a file and open it in your browser. It uses the same code as the preview.

View HTML
<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Circular Text</title>
  <style>
    :root {
      color-scheme: dark;
      --demo-bg: #171629;
      --demo-ink: #f8f5ff;
      --demo-accent: #b9a6ff;
      --demo-muted: #bfbbd3;
      font-family: system-ui, sans-serif;
      color: var(--demo-ink);
      background: var(--demo-bg);
    }

    *, *::before, *::after { box-sizing: border-box; }
    body { margin: 0; min-width: 0; }
    button, input { font: inherit; }

    .demo {
      display: grid;
      place-items: center;
      align-content: center;
      min-height: 100vh;
      padding: 14px;
      overflow: hidden;
      background: radial-gradient(ellipse at 50% 24%, #28233f, var(--demo-bg) 78%);
    }

    .demo-button {
      border: 1px solid #ffffff3d;
      border-radius: 7px;
      background: #ffffff12;
      color: var(--demo-ink);
      padding: 6px 11px;
      font-size: 12px;
      cursor: pointer;
    }

    :focus-visible {
      outline: 2px solid var(--demo-accent);
      outline-offset: 3px;
    }

    .demo { background: radial-gradient(ellipse at 50% 32%, #2d4688, #101c39 78%); }
    .seal { display: block; width: clamp(108px, 67vh, 196px); max-width: 100%; filter: drop-shadow(0 9px 20px #030a2290); }
    .seal-lettering {
      fill: #ffddad;
      font: 720 13px/1 system-ui, sans-serif;
      text-transform: uppercase;
      transform-box: view-box;
      transform-origin: center;
      animation: rotate-seal 16s linear infinite;
    }
    @keyframes rotate-seal { to { transform: rotate(1turn); } }

    .motion-example { display: grid; place-items: center; gap: 12px; }
    .motion-example [data-motion] { animation-play-state: paused; }
    .motion-example[data-playing] [data-motion] { animation-play-state: running; }
    @media (prefers-reduced-motion: reduce) {
      .motion-example [data-motion] { animation: none; }
      .motion-example button { display: none; }
    }
  </style>
</head>
<body>
  <main class="demo">
    <div class="motion-example">
      <svg class="seal" viewBox="0 0 180 180" role="img" aria-label="Shape in motion">
        <defs><path id="letter-ring" d="M90 21a69 69 0 1 1 0 138 69 69 0 1 1 0-138z"/></defs>
        <circle cx="90" cy="90" r="84" fill="#101d42" stroke="#c5d7f3" stroke-opacity=".43"/>
        <circle cx="90" cy="90" r="54" fill="#20366d" stroke="#c5d7f3" stroke-opacity=".52"/>
        <circle cx="90" cy="90" r="43" fill="none" stroke="#bac8ff" stroke-opacity=".27" stroke-dasharray="1 5"/>
        <path fill="#f9cfa0" d="M90 51q5 34 39 39-34 5-39 39-5-34-39-39 34-5 39-39z"/>
        <circle cx="90" cy="90" r="6" fill="#20366d"/>
        <text class="seal-lettering" data-motion><textPath href="#letter-ring" textLength="423" lengthAdjust="spacing">Shape in motion ✦ Shape in motion ✦ </textPath></text>
      </svg>
      <button class="demo-button" type="button" data-testid="effect-demo-loop-toggle">Play demo</button>
    </div>
  </main>
  <script>
    const example = document.querySelector('.motion-example');
    const toggle = example.querySelector('button');
    toggle.addEventListener('click', () => {
      const playing = example.toggleAttribute('data-playing');
      toggle.textContent = playing ? "Pause demo" : "Play demo";
    });
  </script>
</body>
</html>

Original example by UI Skills