---
title: "Reply to PDF annotations using JavaScript | Nutrient SDK"
canonical_url: "https://www.nutrient.io/guides/web/annotations/comments-and-replies/replies/"
md_url: "https://www.nutrient.io/guides/web/annotations/comments-and-replies/replies.md"
last_updated: "2026-05-23T00:08:18.163Z"
description: "Discover how to use annotation replies for threaded comments in Nutrient Web SDK and improve your PDF collaboration experience today."
---

# Reply to annotations in our JavaScript PDF viewer

Annotation replies allow you to create a thread of comments in a PDF document. Nutrient Web SDK will display any [comments](https://www.nutrient.io/guides/web/annotations/comments-and-replies/comments.md) you create as a threaded conversation.![A thread of comments](@/assets/guides/web/annotations/instant-comments-thread.png)

In addition, if you open a document where comments were created by any of the Nutrient SDKs, these comments will be displayed in a thread too.

Annotation replies created by other PDF software aren’t supported by Nutrient Web SDK; they’re displayed as individual [note annotations](https://www.nutrient.io/api/web/classes/NutrientViewer.Annotations.NoteAnnotation.html).

## Disabling replies

If you want to prevent users from replying to comments while still allowing them to create new top-level comments, you can use the [`setIsEditableComment`](https://www.nutrient.io/api/web/classes/NutrientViewer.Instance.html#setiseditablecomment) method:

```javascript

let comments = await instance.getComments();

instance.addEventListener("comments.change", async () => {
  comments = await instance.getComments();
});

instance.setIsEditableComment((comment) => {
  return!comments.find((_comment) => _comment.rootId === comment.rootId);
});

```

How this works:

- `comments` is initialized with the existing comments and refreshed whenever comments change.

- The callback checks whether a comment with the same `rootId` already exists. This enables starting a new thread, while comments in an existing thread aren’t editable and new replies can’t be added.

With this configuration, users can still create new comments on the document, but they won’t be able to add replies to existing comments.
---

## Related pages

- [Adding comments and replies in our JavaScript PDF viewer](/guides/web/annotations/comments-and-replies/comments.md)

