# moveBlock (@salmonui/rich-text)

> The moveBlock function of @salmonui/rich-text: Moves a block (with its children) before or after another block, or into another block's children. Moving a block into itself or its own subtree, or relative to a missing block, returns the input unchanged.

Canonical: https://salmonui.dev/docs/reference/rich-text/moveBlock

```ts
import { moveBlock } from '@salmonui/rich-text';
```

Entry index: https://salmonui.dev/docs/reference/rich-text (Markdown with every symbol of the entry: https://salmonui.dev/docs/reference/rich-text.md).

## Reference

Kind: function

```ts
function moveBlock(blocks: readonly Block[], id: string, position: BlockPosition): Block[];
```

Moves a block (with its children) before or after another block, or into
another block's children. Moving a block into itself or its own subtree,
or relative to a missing block, returns the input unchanged.
