Skip to main content

Comments API

Initialization

interface CommentsConfig {
// Array of comments to be displayed
value?: Comment[];
// List of users to mention in comments
users?: User[];
// ID of the active user
activeUser?: number;
// Function to format the comment content
format?: (text: string) => string | "markdown" | "text";
// Flag to auto-focus the editor on render
focus?: boolean;
// Flag to render the widget in read-only mode
readonly?: boolean;
// Custom component or string for rendering messages
render?: string | Component;
// Callback function when comments data changes
onChange?: (change: OnChange) => void;
// Callback function to retrieve comments data
onData?: (id: number) => Promise<Comment[]> | Comment[];
}

Comments Properties

activeUserOptional. Identifies the current user in the comments widget
focusOptional. Controls whether the comments editor should be auto-focused after rendering
formatOptional. Controls how the message content is rendered in the comments widget
readonlyOptional. Controls whether the comments widget is in read-only mode
renderOptional. Controls how messages are displayed in the widget
usersOptional. Provides a list of users that can be associated with comments
valueOptional. Provides a list of users that can be referenced in the comments widget

Comments Events

changeFires when comments data has been changed
dataThe event is triggered to fetch comments data
  • Visit the Features Guide to learn more about the widget's functionality.
  • Explore the samples to visualize the available features.