---
title: "Layouts and dots"
description: "Pick where the dots sit with 7 named layouts or your own grid, how many dots fit a size, and which of 9 dot shapes to draw."
url: "https://dotsengine.dev/docs/layouts"
markdown: "https://dotsengine.dev/docs/layouts.md"
updated: 2026-12-01
---

# Layouts and dots

Pick where the dots sit with 7 named layouts or your own grid, how many dots fit a size, and which of 9 dot shapes to draw.

> The other pages of this site, each with its Markdown copy, are listed in [llms.txt](https://dotsengine.dev/llms.txt).

A layout is the set of places where dots can light. We call it a lattice. The same pattern runs on any lattice, so you can change the outline and keep the movement.

## Named layouts

For `n` dots along the height, each layout makes this grid:

| `lattice` | Shape | Grid |
| --- | --- | --- |
| `square` (default) | A full square of dots | `n` × `n` |
| `circle` | A round panel | `n` × `n`, cut to a circle |
| `rounded` | A square with soft corners | `n` × `n`, cut to a rounded square |
| `ring` | A circle with an empty middle | `n` × `n`, cut to a ring half as wide as the circle |
| `capsule` | A pill, about twice as wide as it is tall | `2n + 1` × `n`, cut to a pill |
| `bar` | A strip three times as wide as it is tall | `3n` × `n` |
| `hex` | Rows offset by half a dot, packed as a honeycomb | `n` × `n + 2`, cut to a circle |

```dot-matrix
[
  { "name": "square", "pattern": "orbit" },
  { "name": "circle", "pattern": "orbit", "lattice": "circle" },
  { "name": "rounded", "pattern": "orbit", "lattice": "rounded" },
  { "name": "ring", "pattern": "orbit", "lattice": "ring" },
  { "name": "hex", "pattern": "orbit", "lattice": "hex" }
]
```

```dot-matrix
[
  { "name": "capsule", "pattern": "scan", "lattice": "capsule", "color": "chart-2" },
  { "name": "bar", "pattern": "scan", "lattice": "bar", "color": "chart-2" }
]
```

## Your own grid

Pass an object for any number of columns and rows. A preset allows up to 64 of each.

| Key | Type | Default | What it does |
| --- | --- | --- | --- |
| `cols` | number | required | Dots across |
| `rows` | number | required | Dots down |
| `mask` | `rect`, `circle`, `rounded`, `capsule` or `ring` | `rect` | The outline. A dot stays when its middle is inside it |
| `hex` | boolean | `false` | Shifts every other row by half a dot and packs the rows closer: a honeycomb |

Your own grid is fixed: `size` and `look.grid` do not change its number of dots. The dots get smaller as the grid grows.

```tsx
<DotMatrix pattern="marquee" lattice={{ cols: 31, rows: 7 }} size={28} />
```

```dot-matrix
{ "name": "31 × 7", "pattern": "marquee", "lattice": { "cols": 31, "rows": 7 }, "size": 28, "color": "chart-4" }
```

## How many dots

`size` is the height in CSS pixels. The width follows from the lattice. The engine picks the number of dots along the height for you:

- It keeps the dots at least 4px apart. Closer than that, a dot and its gap merge and the pattern reads as noise.
- It never uses more dots than the pattern reads well at (the scene's `most`, 9 by default).
- It always picks an odd number, so a pattern has a middle dot.
- It never uses fewer than 3.

Set `look.grid` when you want a fixed number. Fix it when one loader switches between patterns. Then the grid does not change in the middle of a morph.

```dot-matrix
[
  { "name": "grid 5", "pattern": "spiral", "lattice": "circle", "grid": 5, "color": "chart-5" },
  { "name": "grid 9", "pattern": "spiral", "lattice": "circle", "grid": 9, "color": "chart-5" },
  { "name": "grid 15", "pattern": "spiral", "lattice": "circle", "grid": 15, "color": "chart-5" }
]
```

## Dot shapes

`look.dot` sets how each dot is drawn. `round` is an LED, `square` a panel cell, and `pixel` a soft square. The rest are marks.

```dot-matrix
[
  { "name": "round", "pattern": "pulse", "dot": "round", "grid": 7 },
  { "name": "square", "pattern": "pulse", "dot": "square", "grid": 7 },
  { "name": "pixel", "pattern": "pulse", "dot": "pixel", "grid": 7 },
  { "name": "diamond", "pattern": "pulse", "dot": "diamond", "grid": 7 },
  { "name": "plus", "pattern": "pulse", "dot": "plus", "grid": 7 }
]
```

```dot-matrix
[
  { "name": "triangle", "pattern": "pulse", "dot": "triangle", "grid": 7 },
  { "name": "star", "pattern": "pulse", "dot": "star", "grid": 7 },
  { "name": "ring", "pattern": "pulse", "dot": "ring", "grid": 7 },
  { "name": "dash", "pattern": "pulse", "dot": "dash", "grid": 7 }
]
```
