# insertBlocks (@salmonui/rich-text)

> The insertBlocks function of @salmonui/rich-text: Inserts blocks before or after the block before / after, or into parent's children at index (default: last). Without a position they go at the end. Returns the input unchanged when the anchor does not exist.

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

```ts
import { insertBlocks } 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 insertBlocks(blocks: readonly Block[], inserted: readonly Block[], position?: BlockPosition): Block[];
```

Inserts blocks before or after the block `before` / `after`, or into
`parent`'s children at `index` (default: last). Without a position they go
at the end. Returns the input unchanged when the anchor does not exist.
