Select some text and leave a comment
Try selecting some of this text!
Wrapping parts of your HTML with <experimental.SelectionComments />
enables leaving comments after selecting text, just like in Notion. This component also renders all the existing comments on a page.
When users select text in an HTML element nested inside <experimental.SelectionComments />
, a customizable "Comment" button will appear. Clicking on it will render a floating composer, allowing users to leave a comment. You can retrieve and reply to an existing comment by clicking on the pins on the page.
This component pairs well with:
import { betaV2 } from "@cord-sdk/react";
export const Example = () => {
return (
<experimental.SelectionComments location={{ "page": "index" }} >
<p>Try selecting this text!</p>
</experimental.SelectionComments>
);
};
window.location
).Add comment
.Not finding the answer you need? Ask our Developer Community