-
Notifications
You must be signed in to change notification settings - Fork 111
Mrk 939 advanced customization #918
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
jainpawan21
merged 18 commits into
MRK-935-inbox-architecture
from
MRK-939-advanced-customization
Aug 12, 2025
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
af11de8
Content for renderbody, renderSubject and renderNotification
Aviatorscode2 cdf5db9
Added content to the custom notification page
Aviatorscode2 20d386b
Content for the display HTML in notfications page
Aviatorscode2 e2775bc
Update description
Aviatorscode2 eca7c7e
Restructure the name and writiign content for customize bell and popo…
Aviatorscode2 d170158
Content for the bell and popover and added content to customize notif…
Aviatorscode2 3fd9b7d
Update content/docs/platform/inbox/advanced-customization/customize-b…
Aviatorscode2 8df78b1
Update content/docs/platform/inbox/advanced-customization/customize-b…
Aviatorscode2 49e0841
Update content/docs/platform/inbox/advanced-customization/customize-n…
Aviatorscode2 23a016b
Update content/docs/platform/inbox/advanced-customization/html-in-not…
Aviatorscode2 3069090
Update content/docs/platform/inbox/advanced-customization/customize-n…
Aviatorscode2 fbec862
Update content/docs/platform/inbox/advanced-customization/html-in-not…
Aviatorscode2 23f4a87
Update content/docs/platform/inbox/advanced-customization/customize-n…
Aviatorscode2 980020e
Update content/docs/platform/inbox/advanced-customization/customize-n…
Aviatorscode2 7350215
Update content/docs/platform/inbox/advanced-customization/customize-n…
Aviatorscode2 192b05a
Update content/docs/platform/inbox/advanced-customization/customize-n…
Aviatorscode2 fe6f293
Update based on feedback
Aviatorscode2 1dc1a7a
Update content/docs/platform/inbox/advanced-customization/html-in-not…
jainpawan21 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
10 changes: 0 additions & 10 deletions
10
content/docs/platform/inbox/advanced-customization/custom-bell.mdx
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
content/docs/platform/inbox/advanced-customization/custom-notification.mdx
This file was deleted.
Oops, something went wrong.
136 changes: 136 additions & 0 deletions
136
content/docs/platform/inbox/advanced-customization/customize-bell-and-popover.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,136 @@ | ||||||
| --- | ||||||
| title: 'Customize Bell and Popover' | ||||||
| description: "Learn how to fully customize the inbox component bell and trigger a custom notification feed using your own components or third-party libraries." | ||||||
| icon: 'BellRing' | ||||||
| --- | ||||||
|
|
||||||
| Novu's Inbox component provides a built-in notification bell and popover that displays the notification feed. | ||||||
|
|
||||||
| This default behavior is suitable for most use cases, but you may want to customize the bell icon or control how and where the notification list is displayed, especially when integrating with your own design system or third-party UI libraries. | ||||||
|
|
||||||
| ## Replace the default bell icon | ||||||
|
|
||||||
| Use the `renderBell` prop to replace the default bell icon in the inbox component with your own custom component. | ||||||
|
|
||||||
|  | ||||||
|
|
||||||
| <Tabs items={['Custom bell', 'Custom bell with showing unread count']}> | ||||||
| <Tab> | ||||||
|
|
||||||
| ```tsx | ||||||
| import { Inbox } from '@novu/react'; | ||||||
|
|
||||||
| function CustomBell() { | ||||||
| return ( | ||||||
| <Inbox | ||||||
| applicationIdentifier="YOUR_APPLICATION_IDENTIFIER" | ||||||
| subscriber="YOUR_SUBSCRIBER_ID" | ||||||
| renderBell={() => { | ||||||
| return ( | ||||||
| <div className="bg-blue-300 p-4 inline-flex"> | ||||||
| New notifications | ||||||
| </div> | ||||||
| ); | ||||||
| }} | ||||||
| /> | ||||||
| ); | ||||||
| } | ||||||
| export default CustomBell; | ||||||
| ``` | ||||||
|
|
||||||
| </Tab> | ||||||
| <Tab> | ||||||
|
|
||||||
| ```tsx | ||||||
| import { Inbox } from '@novu/react'; | ||||||
|
|
||||||
| function CustomBell() { | ||||||
| return ( | ||||||
| <Inbox | ||||||
| applicationIdentifier="YOUR_APPLICATION_IDENTIFIER" | ||||||
| subscriber="YOUR_SUBSCRIBER_ID" | ||||||
| renderBell={(unreadCount) => { | ||||||
| return ( | ||||||
| <div className="bg-blue-300 p-4 inline-flex">New {unreadCount }notifications</div> | ||||||
| ); | ||||||
| }} | ||||||
| /> | ||||||
| </Inbox> | ||||||
| ); | ||||||
| } | ||||||
| export default CustomBell; | ||||||
| ``` | ||||||
|
|
||||||
| </Tab> | ||||||
| </Tabs> | ||||||
|
|
||||||
|
|
||||||
Aviatorscode2 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
| ## Custom popover trigger | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| By default, the Inbox component displays the notification popover containing the notification list when the bell icon is clicked. However, you can decouple the display logic and mount the notification content inside your own panel or modal component. | ||||||
|
|
||||||
| Use the `<InboxContent />` and `<Notifications />` component to display just the notification list. This provides a flexible way to customize the inbox display using external UI libraries like [Radix UI](https://www.radix-ui.com/) or [Shadcn](https://ui.shadcn.com/docs/installation) while maintaining all the core notification functionality. | ||||||
|
|
||||||
| <Tabs items={['Using <InboxContent /> and Radix UI', 'Using <Notifications /> and Radix UI']}> | ||||||
| <Tab> | ||||||
| ```tsx | ||||||
| import { Inbox, InboxContent, Bell } from '@novu/react'; | ||||||
| import { Popover, PopoverTrigger } from '@radix-ui/react-popover'; | ||||||
| import { PopoverContent } from '@radix-ui/react-popover'; | ||||||
|
|
||||||
|
|
||||||
| function CustomPopoverPage() { | ||||||
|
|
||||||
| return ( | ||||||
| <Inbox | ||||||
| applicationIdentifier="YOUR_APPLICATION_IDENTIFIER" | ||||||
| subscriber="YOUR_SUBSCRIBER_ID" | ||||||
| > | ||||||
| <Popover> | ||||||
| <PopoverTrigger> | ||||||
| <Bell /> | ||||||
| </PopoverTrigger> | ||||||
| <PopoverContent className="h-[600px] w-[400px] p-0"> | ||||||
| <InboxContent /> | ||||||
| </PopoverContent> | ||||||
| </Popover> | ||||||
| </Inbox> | ||||||
| ); | ||||||
| } | ||||||
|
|
||||||
| export default CustomPopoverPage; | ||||||
| ``` | ||||||
|
|
||||||
| </Tab> | ||||||
| <Tab> | ||||||
|
|
||||||
| ```tsx | ||||||
| import { Inbox, Notifications, Bell } from '@novu/react'; | ||||||
| import { Popover, PopoverTrigger } from '@radix-ui/react-popover'; | ||||||
| import { PopoverContent } from '@radix-ui/react-popover'; | ||||||
|
|
||||||
|
|
||||||
| function CustomPopoverPage() { | ||||||
|
|
||||||
| return ( | ||||||
| <Inbox | ||||||
| applicationIdentifier="YOUR_APPLICATION_IDENTIFIER" | ||||||
| subscriber="YOUR_SUBSCRIBER_ID" | ||||||
| > | ||||||
| <Popover> | ||||||
| <PopoverTrigger> | ||||||
| <Bell /> | ||||||
| </PopoverTrigger> | ||||||
| <PopoverContent className="h-[600px] w-[400px] p-0"> | ||||||
| <Notifications /> | ||||||
| </PopoverContent> | ||||||
| </Popover> | ||||||
| </Inbox> | ||||||
| ); | ||||||
| } | ||||||
|
|
||||||
| export default CustomPopoverPage; | ||||||
| ``` | ||||||
|
|
||||||
| </Tab> | ||||||
| </Tabs> | ||||||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not use Popover
https://developers.google.com/style/word-list#pop-up
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace with "dialog" throughout.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the reason why I stuck to using popover was because, if you check the code, you will see that the components used are called popover and the UI libraries (Radix UI, Shadcn) used refer to it as "popover".
My thought is that using "dialog" instead of popover might be an issue for the developers. Seeing dialog as the heading while the code uses popover could be confusing.
These are my reasons @DianaHackmamba let me know your thoughts.