Notifications component
<wy-notifications> | WyNotifications
Weavy automatically creates notifications for reactions, mentions and other activities. With the Notifications component you can display these notifications, mark them as read/unread, and handle navigation when a notification is clicked.
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 { WyNotifications } from "@weavy/uikit-web";
Examples
Display all notifications for the authenticated user.
<wy-notifications></wy-notifications>
Display notifications for the authenticated user that originated from app with the specified uid
.
<wy-notifications uid="test-chat"></wy-notifications>
Properties
Property | Type | Description |
---|---|---|
uid |
string |
Optional filter to only show notifications for app with uid . |
Learn more about attributes and properties.
Events
Name | Description |
---|---|
wy:link |
Emitted when a notification is clicked. |
Learn more about events.
Methods
The component exposes the following methods.
markAllAsRead()
Marks all notifications as read. Respects any filtering set by the uid
property.