@sirenapp/vue-inbox
SDK is a comprehensive and customizable Vue 3 UI kit for displaying and managing notifications. This documentation provides comprehensive information on how to install, configure, and use the SDK effectively.
Prop | Description | Type | Default |
---|---|---|---|
theme | Object for custom themes | Theme | {} |
customStyles | Object for custom styling | CustomStyle | {} |
loadMoreLabel | Text shown on the load more component | string | ”Load More” |
hideBadge | Toggle to hide or show the badge | boolean | false |
darkMode | Toggle to enable dark mode | boolean | false |
itemsPerFetch | Number of notifications per API request (max 50) | number | 20 |
windowViewOnly | Toggle for fit-to-screen window or modal view | boolean | false |
headerProps | Props for customizing the header | HeaderProps | { title: 'Notifications', hideHeader: false, hideClearAll: false } |
cardProps | Props for customizing notification cards | CardProps | { hideDelete: false, hideAvatar: false, disableAutoMarkAsRead: false, onAvatarClick: ()=>null } |
onCardClick | Click handler for notification cards | (notification) => void | () => null |
onError | Error handler | (error: SirenErrorType) => void | () => null |
Slot | Description |
---|---|
loadMoreComponent | Custom load more button component |
customHeader | Custom header component |
customLoader | Custom loader component |
customErrorWindow | Custom error window |
listEmptyComponent | Custom empty list component |
customCard | Custom notification card component |
customFooter | Custom footer component |
notificationIcon | Custom notification icon component |
useSiren
hook provides utility functions for modifying notifications:
Function | Parameters | Type | Description |
---|---|---|---|
markAsReadByDate | startDate | ISO date string | Sets notifications as read until the given date |
markAsReadById | id | string | Marks a specific notification as read |
deleteById | id | string | Deletes a specific notification |
deleteByDate | startDate | ISO date string | Deletes notifications until the given date |
markAllAsViewed | createdAt | ISO date string | Marks notifications as viewed until the given date |
SirenProvider
userToken
and recipientId
are correct