Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions packages/website/content/docs/api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,16 @@ setContents(delta: Delta, source: string = 'api'): Delta

**Examples**

```typescript
quill.setContents({
ops:[
{ insert: 'Hello ' },
{ insert: 'World!', attributes: { bold: true } },
{ insert: '\n' },
]
});
```
or
```typescript
quill.setContents([
{ insert: 'Hello ' },
Expand All @@ -189,6 +199,7 @@ quill.setContents([
]);
```


### setText

Sets contents of editor with given text, returning a [Delta](/docs/delta/) representing the change. Note Quill documents must end with a newline so one will be added for you if omitted. [Source](/docs/api/#events) may be `"user"`, `"api"`, or `"silent"`. Calls where the `source` is `"user"` when the editor is [disabled](#disable) are ignored.
Expand Down