All effectsVisual styles

Dot Pattern

点阵背景

Evenly spaced dots repeat on a regular lattice behind the content.

Look for the repeated spacing between dots

Where to use it

Add a quiet texture to a diagram canvas, empty state or hero backdrop. Keep the pattern faint under cards or controls, and let it show through the open parts of the canvas.

Practical example

A seating-plan editor shows a faint, evenly spaced dot field behind its tables. The visible gaps between tables retain a sense of scale, and table numbers stay clear on solid fills.

AI prompt

Use a Dot Pattern behind [target content]. Repeat a small radial gradient at regular spacing and use a low-contrast dot color. Fade it where content needs a clear backdrop and prevent it from changing the hit areas.

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>Dot Pattern</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;
    }

    .visual-specimen {
      width: min(100%, 290px);
      height: 124px;
      display: grid;
      place-items: center;
      position: relative;
      isolation: isolate;
    }
    .dot-paper {
      position: relative; overflow: hidden; width: min(100%, 223px); height: 102px; border-radius: 10px;
      background: radial-gradient(circle, #9a86bf 1.2px, transparent 1.4px) 2px 2px / 13px 13px, #29213c;
    }
    .dot-paper i { position: absolute; left: 23%; top: 41%; width: 28px; height: 23%; border: 1px solid #e5ccfb; background: #675682; border-radius: 4px; }
    .dot-paper i:last-child { left: 63%; top: 27%; border-color: #bbebbc; background: #375c52; }
    .dot-paper i:first-child::after { content: ''; position: absolute; top: 46%; left: 100%; width: 62px; height: 1px; background: #d0b9ec; }
  </style>
</head>
<body>
  <main class="demo">
    <div class="visual-specimen" aria-hidden="true"><div class="dot-paper"><i></i><i></i></div></div>
  </main>
</body>
</html>

Original example by UI Skills