Skip to main content

Overview

The Contextual Comments component embeds a fully customizable commenting experience into your web application, allowing users to interact and collaborate seamlessly within the context of specific elements on the page.

Quickstart

Follow the steps below to get started with adding contextual comments to your app, based on the type of HTML element you plan to use (either <canvas> or <div>).

1

Before we start

Before utilizing the Mouse Pointers component, it is essential to initialize a room with a defined name and ID for the participant and the group. You need to have the room variable to add the Mouse Pointers component.

2

Setup your HTML element

Add a <canvas> element with a unique ID to your HTML:

<canvas id="my-id" width="540" height="540"></canvas>
3

Import components and instanciate CanvasPin

Import the Comments component and the CanvasPin pin adapter. Initialize the CanvasPin adapter by passing the ID of the canvas element:

import { Comments, CanvasPin } from '@superviz/sdk';

const pinAdapter = new CanvasPin("my-id");
4

Initialize Comments and add the component

Create an instance of Comments using the pin adapter, then add it to the already initialized room:

const comments = new Comments(pinAdapter);

room.addComponent(comments);

Resources to get you started

We've prepared a few resources to help you get started with the Contextual Comments component and use it alosing with other components to create a collaborative environment.