---
title: "Motion"
description: "Control speed and pause, play a pattern once for a result, drive a loader from a progress value, and choose how a change travels over the dots."
url: "https://dotsengine.dev/docs/motion"
markdown: "https://dotsengine.dev/docs/motion.md"
updated: 2026-12-01
---

# Motion

Control speed and pause, play a pattern once for a result, drive a loader from a progress value, and choose how a change travels over the dots.

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

A loader loops by default. These props change how it moves, and how it moves from one state to the next.

## Speed and pause

`look.speed` scales the loop: 2 is twice as fast, 0.5 half as fast. A preset allows 0.05 to 10. `state="paused"` holds the current frame.

```tsx
<DotMatrix pattern="helix" look={{ speed: 2 }} />
<DotMatrix pattern="helix" state={busy ? "running" : "paused"} />
```

```dot-matrix
[
  { "name": "speed 0.5", "pattern": "helix", "speed": 0.5, "color": "chart-3" },
  { "name": "speed 1", "pattern": "helix", "speed": 1, "color": "chart-3" },
  { "name": "speed 2", "pattern": "helix", "speed": 2, "color": "chart-3" }
]
```

## Play once for a result

A scene with `once` plays one time and holds its last frame. Use it for a result, not a wait. `check` and `cross` are built in. Their `outcome` tells screen readers "Done" or "Something went wrong". Press Replay to see them again.

```dot-matrix
[
  { "name": "check", "pattern": "check", "lattice": "circle", "color": "success" },
  { "name": "cross", "pattern": "cross", "lattice": "circle", "color": "destructive" }
]
```

## Follow a value

`value` is an input from 0 to 1, such as a download's progress or a voice level. Patterns with an input bake it in steps. The canvas and WebGL renderers blend the two nearest steps, so the dots move smoothly as `value` changes. The DOM and SVG renderers show the nearest step.

```tsx
<DotMatrix pattern="progressRing" lattice="circle" value={loaded / total} />
```

```dot-matrix
[
  { "name": "0.25", "pattern": "progressRing", "lattice": "circle", "value": 0.25, "color": "info" },
  { "name": "0.5", "pattern": "progressRing", "lattice": "circle", "value": 0.5, "color": "info" },
  { "name": "0.9", "pattern": "progressRing", "lattice": "circle", "value": 0.9, "color": "info" }
]
```

In your own scene, read the input with `{ "fn": "ref", "name": "input" }` and set the scene key `input` to the number of steps, from 2 to 65. The built-in `progress` uses 33. More steps cost more bake time.

## Change state

When `pattern`, `lattice` or `color` changes, the dots travel from the old state to the new one in 560ms. `look.morph` sets the order the dots move in:

| `morph`          | How the dots move                          |
| ---------------- | ------------------------------------------ |
| `wave` (default) | A ring spreads out from the middle         |
| `implode`        | From the edge to the middle                |
| `sweep`          | From one side to the other                 |
| `dissolve`       | In a random order                          |
| `flow`           | Every dot at the same time, a smooth blend |
| `fly`            | Each lit dot flies to a new place          |
| `none`           | At once, with no motion                    |

```tsx
<DotMatrix pattern={done ? "check" : "spinner"} look={{ morph: "fly" }} />
```

A morph needs a running loader on screen. A paused or hidden loader, and a change of `size`, `look.dot`, `look.glow`, `look.floor` or `renderer`, swap at once.

Two more props cover the edges of a loader's life:

- `active={false}` morphs every dot dark, for an exit. Keep the loader mounted while it fades.
- `enter` morphs in from dark the first time the loader comes on screen.

[Loading states](https://dotsengine.dev/docs/states.md) shows these props wired to real app state.
