# Fan out merge

Parallel work, drawn as it runs: lanes branch out as tasks start and run on to the join as they finish.

Also called: parallel tasks animation.

> chatcn Pro: needs a Pro license (https://chatcn.dev/pro). Install from the `@chatcn-pro` registry with your license token; setup at https://chatcn.dev/docs/chatcn-pro.

Example: Parallel work, drawn as it runs. One search splits into three lanes; each line draws out as its task starts and runs on to the join when it finishes, then they merge. Preview: https://chatcn.dev/preview/fan-out-merge-demo

The call at the top splits into lanes that branch out side by side, one per parallel task, each line drawing out to its task as it starts. When a task finishes its line runs on down to the join; when the last one arrives the lanes merge into a single result. You can see at a glance which branch is holding the rest up.

## Installation

```bash
npx shadcn@latest add @chatcn-pro/fan-out-merge
```

## Usage

```tsx
import { FanOutMerge } from "@/components/ui/chatcn/pro/fan-out-merge"

<FanOutMerge title="Search 3 sources in parallel" lanes={lanes} result="Found the cause in auth/refresh.ts" />
```

## Props

| Prop | Type | Notes |
| --- | --- | --- |
| `title` | `string` | The call that fans out |
| `lanes` | `{ id, label, detail?, status }[]` | Status as in Run check |
| `result` | `string` | Once every lane is done |

## Accessibility

- The end node is a `role="status"`: Waiting for 2 of 3, then the result.

## Motion

- Curves are measured from the boxes and drawn with `pathLength`, 420 ms each. Reduced motion: lines appear.

Source: https://chatcn.dev/docs/components/fan-out-merge