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[];
}

Properties

  • value - array of comments to be displayed
  • users - list of users to mention in comments
  • activeUser - ID of the active user
  • format - function to format the comment content
  • focus - flag to auto-focus the editor on render
  • readonly - flag to render the widget in read-only mode
  • render - custom component or string for rendering messages

Events

  • onchange - triggered when comments data changes
  • ondata - triggered when retrieving comments data
  • Visit the Features Guide to learn more about the widget's functionality.
  • Explore the samples to visualize the available features.