Skip to main content
CometChatNotificationFeed displays a scrollable notification feed where each item is rendered as a card using @cometchat/cards-react. It handles fetching, pagination, category filtering, timestamp grouping, real-time updates, and read/delivered/engagement reporting automatically.
Live Preview — interact with the notification feed component.Open in Storybook ↗

Where It Fits

CometChatNotificationFeed is a full-screen component. Drop it into a page or route. It manages its own data fetching, state, and real-time listeners — you just handle navigation callbacks.

Minimal Render

Prerequisites: CometChat SDK initialized with CometChatUIKit.init() and a user logged in. Root CSS class: .cometchat-notification-feed

Filtering Feed Items

Control what loads using custom request builders:

Filter Options


Actions and Events

Callback Props

onItemClick

Fires when a feed item card is clicked.

onActionClick

Fires when an interactive element (button, link) inside a card is clicked. The action object contains the action type, parameters, and the element ID that triggered it.

onError

Fires when an internal error occurs (network failure, SDK exception).

onBackPress

Fires when the back button in the header is clicked.

Automatic Behaviors

The component handles these automatically — no manual setup needed:

Customization

View Props

Compound Composition

For full layout control, use sub-components. Omit any sub-component to hide it:
Available sub-components:

CSS Styling

Override design tokens on the component selector:

CSS Classes


Props

All props are optional.

title

Header title text.

showHeader

Shows/hides the entire header.

showBackButton

Shows/hides the back button in the header.

showFilterChips

Shows/hides the category filter chips row.

notificationFeedRequestBuilder

Custom request builder for fetching feed items.

notificationCategoriesRequestBuilder

Custom request builder for fetching categories.

onItemClick

Callback fired when a feed item card is clicked.

onActionClick

Callback fired when an interactive element inside a card is clicked. The CardAction object contains:
  • type — Action type (e.g., "openUrl", "chatWithUser")
  • params — Action parameters (e.g., { url: "..." }, { uid: "..." })
  • elementId — ID of the element that triggered the action

onError

Callback fired when the component encounters an error.

onBackPress

Callback fired when the back button is pressed.

cardThemeMode

Theme mode for the card renderer (@cometchat/cards-react).

cardThemeOverride

Custom theme override passed to the card renderer.

headerView

Custom component replacing the entire header.

loadingView

Custom component displayed during the initial loading state.

errorView

Custom component displayed when an error occurs.

emptyView

Custom component displayed when there are no notifications.

itemView

Custom renderer for each feed item.

Additional Exports

useNotificationUnreadCount

A React hook for tracking unread notification count. Uses a shared singleton — multiple components share one polling interval and WebSocket listener.

Options

Return Value


Common Patterns

Show only unread items

Hide filter chips and header

Embed in a sidebar

Add notification badge to navigation


Next Steps

Campaigns Feature

Overview of how campaigns work end-to-end

SDK Campaigns API

Low-level SDK APIs for feed items, categories, and engagement

Theming

Customize colors, fonts, and appearance

Components

Browse all prebuilt UI components