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 displayedusers
- list of users to mention in commentsactiveUser
- ID of the active userformat
- function to format the comment contentfocus
- flag to auto-focus the editor on renderreadonly
- flag to render the widget in read-only moderender
- custom component or string for rendering messages
Events
Related resources
- Visit the Features Guide to learn more about the widget's functionality.
- Explore the samples to visualize the available features.