> For the complete documentation index, see [llms.txt](https://typing-flow.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://typing-flow.gitbook.io/docs/plugins/chain.md).

# chain

Plugin for creating linked animations. That is, when one ends, the next one begins.

{% hint style="warning" %}
Be careful with looping animations when using **chain**
{% endhint %}

### Usage

```typescript
import { TypingFlow } from "typing-flow";
import { chain } from "typing-flow/plugins";

const flow1 = new TypingFlow({...}).commands([...]);
const flow2 = new TypingFlow({...}).commands([...]);
const flow3 = new TypingFlow({...}).commands([...]);

// chainedFlow === flow1
const chainedFlow = chain(flow1, flow2, flow3);

chainedFlow.start();
```

**chain** returns the <mark style="color:orange;">first flow</mark> passed. This must be remembered when using.
