Collaboration (Beta)

Comments and collaboration

Add comment threads to the documents in your app. React components handle replies, mentions, emoji reactions, resolving, and links to a specific comment, using the comment data from the Sanity App SDK.

Guides

Use comments in Next.js

Render the comments panel in the Next.js App Router: the client boundary, the stylesheet import, and the styled-components setup.

Use comments in Sanity Studio

Use the comment components in a studio plugin, custom document view, or custom input, with the studio's theme and current user.

Link to a comment

Make a shared link open the comments panel on the comment it names, with wiring for each common router.

Enable mentions

Turn on the mention picker by giving the comments provider a list of users, and query for the mentions that result.

Comment on Portable Text

Add inline comments to a Portable Text editor: highlights under the commented words, linked to the comments panel.

Customize inline comments

Common ways to change what SDKPortableTextComments does once inline comments are wired into your editor.

Show comment counts

Show a comment count next to a field or row with CommentBadge, read the counts efficiently, and open a thread from the badge.

Show a comment preview

Show one comment in a popover from a badge or a highlighted range, and make a comments panel read-only.

Customize comment actions

Add, remove, and reorder the actions on a comment with commentActions and CommentActionBar.

Build a custom comment

Build your own comment card from the primitives the default Comment uses, keeping its behavior and accessibility.

Theme the comment components

Change how the comment components look through the Sanity UI theme, a few typed props, and composition.

Translate the UI text

Replace every string the comment components render with the labels on the provider and on each component.

Sanity logosanity.ioAll Systems Operational© Sanity 2026
Change site theme