Title: Posts Component
Posts component
<wy-posts> | WyPosts
Use the Posts component to render a feed of posts and comments as seen on many social networks.
Importing
If you installed the UIKit with npm
you can use the following snippet to import the component into your project.
Otherwise, if you installed the UIKit as a <script>
you can ignore this section.
import { WyPosts } from "@weavy/uikit-web";
Examples
As seen in this example, specifying the app identifier (uid
) is required, and automatically creates a corresponding app on your Weavy environment when the component is first initialized.
<wy-posts uid="test-posts" name="Test feed"></wy-posts>
Here's another example that render a feed without embeds and polls.
<wy-posts uid="test-feed" noEmbeds noPolls></wy-posts>
It's often useful to base the
uid
on something that identifies the location where the component is rendered. Typically you would use something like a product id, page id, path or URL.
Properties
Most properties are optional and/or has sensible default values. Required properties are indicated with an asterisk (*).
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" . |
features |
string |
Explicit space separated list of enabled features. All default features are enabled when this property is not defined. |
reactions |
string |
Space separated string of unicode emojis to use for reactions. Defaults to reactions from the Weavy instance or <wy-context> . |
Learn more about attributes and properties.
Available features
Features that are available but disabled by default are indicated by parenthesis ().
Feature | Description |
---|---|
attachments |
Possibility to upload local files. |
cloud_files |
Cloud file picker (Google Drive, Dropbox etc.). |
comments |
Commentary feed on entities. |
embeds |
Creating embeds from urls in editor text. |
(google_meet ) |
Google Meet video meetings. |
(meetings ) |
General availability for meetings. This can be ignored if using all individual meeting feature flags, i.e. google_meet , microsoft_teams and zoom_meetings . |
mentions |
Possibility to mention other people from the current directory in the editor. |
(microsoft_teams ) |
Microsoft Teams video meetings. |
polls |
Possibility to create polls in editor. |
previews |
Previews of files and attachments. |
reactions |
Possibility to add emoji reactions to a message, post or comment. |
(zoom_meetings ) |
Zoom video meetings. |
Events
Name | Type | Description |
---|---|---|
wy-link |
WyLinkEventType |
Emitted when a notification is clicked. |
wy-preview-open |
WyPreviewOpenEventType |
Emitted when preview is about to be opened. The event may be prevented. |
wy-preview-close |
WyPreviewCloseEventType |
Emitted when preview is closed |
Learn more about events.