Preferences Button in Custom Header
Hi all, I am trying to customize the header within PopoverNotificationCenter. Is there anyway I can replicate the behavior of the settings/preferences button? I can't seem to find a way to change to the preferences view.
https://docs.novu.co/notification-center/client/react/customization#header-footer-and-empty-state
Novu
Customizing Notification Center - Novu
Learn how to customize the pre built notification center component partially or building your own notification center component from scratch using Novu provided hooks
5 Replies
Hi @fyeung, I'm an AI assistant for Novu. While a team member reviews this question, I'll see if I can find relevant sources for your question.
@fyeung, you just advanced to level 1!
-----------------------------
While I generate an answer, here are some sources that might be helpful:
* Preferences
* API Reference
* Customizing Notification Center
* Subscriber Preference
-----------------------------
Answer
To customize the header in the
PopoverNotificationCenter
and include behavior similar to the settings/preferences button, you can utilize the header
prop to define a custom header component. This component can include a button or another interactive element that triggers the preferences view.
Here's an example of how you might set up a custom header with a preferences button:
In this setup, useNovu
is a hook from Novu that provides access to various methods including showPreferences
, which you can call to switch to the preferences view. This approach allows you to integrate custom functionality into the PopoverNotificationCenter
header while maintaining a seamless user experience.
Please note, ensure that the PopoverNotificationCenter
is wrapped within a NovuProvider
to properly manage the state and functionality of the notification system (1) .@fyeung
Checkout this answer in #🪄│engineering channel
https://discord.com/channels/895029566685462578/1254796503382360084/1254800112186822760