Comments component
The comments component renders a complete and functional user interface for adding comments to something like a product page, blog post etc.
Element: <wy-comments>
Class: WyComments
Usage
First import and configure Weavy
and the WyComments
component.
import { Weavy, WyComments } from "@weavy/uikit-web";
const weavy = new Weavy();
weavy.url = "https://myenvironment.weavy.io";
weavy.tokenFactory = async (refresh) => "token_from_server";
Then add the <wy-comments>
component to your HTML. Note that you must specify a unique identifier (uid
) which automatically creates a corresponding app on your Weavy server when the component is first initialized.
<wy-comments uid="test-comments" name="Test comments"></wy-comments>
The unique identifier (
uid
) is something you decide what it should be. For apps it's often useful to have auid
that is related to the context where the app is displayed. For example"product-123-comments"
or"blog-post-2-comments"
.
Properties
Property | Type | Description |
---|---|---|
uid |
string |
Unique identifier for the app. |
name |
string |
Optional display name for the app (used in notifications etc.) |
notifications |
"button-list" | "none" |
Set the appearance of notifications. Defaults to "button-list" . |
notificationsBadge |
"count" | "dot" | "none" |
Set the appearance of the notification badge. Defaults to "count" . |
The available features are controlled by your product license. To disable a feature you can use the following boolean attributes/properties.
Property | Description |
---|---|
noAttachments |
Disable the possibility to upload local attachments. |
noCloudFiles |
Disable the cloud file picker (Google Drive, Dropbox etc.). |
noMeetings |
Disable Zoom meetings. |
noMentions |
Disable the possibility to mention other people in the directory. |
noPreviews |
Disable previews of files. |
noReactions |
Disable the possibility to add emoji reactions to a comment. |
Example: Render a comments component with the reactions feature disabled.
<wy-comments uid="test-comments" noReactions></wy-comments>