<Bell />
API Reference
Subscribers
- GETGet subscribers
- POSTCreate subscriber
- POSTBulk create subscribers
- GETGet subscriber
- PUTUpdate subscriber
- DELDelete subscriber
- PUTUpdate subscriber credentials
- DELDelete subscriber credentials by providerId
- PATCHUpdate subscriber online status
- GETGet subscriber preferences
- GETGet subscriber global preferences
- PATCHUpdate subscriber preference
- PATCHUpdate subscriber global preferences
- GETGet in-app notification feed for a particular subscriber
- GETGet the unseen in-app notifications count for subscribers feed
- POSTMark a subscriber feed message as seen
- POSTMarks all the subscriber messages as read, unread, seen or unseen. Optionally you can pass feed id (or array) to mark messages of a particular feed.
- POSTMark message action as seen
- GETHandle providers oauth redirect
- GETHandle chat oauth
Topics
Notification
Workflows
Workflow Overrides
Workflow groups
Integrations
Layouts
Execution Details
Organizations
<Bell />
The Bell
component displays the notification bell icon. It can also be used to show the number of unread notifications.
import { Inbox, Bell } from '@novu/react';
function Novu() {
return (
<Inbox
applicationIdentifier="YOUR_APPLICATION_IDENTIFIER"
subscriberId="YOUR_SUBSCRIBER_ID"
>
<Bell />
</Inbox>
);
}
Custom Bell
You can pass any custom components as children to <Bell/>
and render them as custom bell icon.
import { Inbox, Bell } from '@novu/react';
import { BellIcon } from './icons';
function Novu() {
return (
<Inbox>
<Bell
renderBell={(unreadCount) => (
<div>
<span>{unreadCount}</span>
<BellIcon />
</div>
)}
/>
</Inbox>
);
}
Bring your own Popover
<Inbox />
can be mounted in your own popover component. For further
customization, you can also use the renderBell
and renderNotification
render
props. Below is an example of how to use <Inbox />
with Radix
UI.
import React from 'react';
import * as Popover from '@radix-ui/react-popover';
import { BellIcon, Cross2Icon } from '@radix-ui/react-icons';
import { Inbox, Bell, Notifications } from '@novu/react';
import './styles.css';
const PopoverDemo = () => (
<Inbox
applicationIdentifier="YOUR_APPLICATION_IDENTIFIER"
subscriberId="YOUR_SUBSCRIBER_ID"
>
<Popover.Root>
<Popover.Trigger asChild>
<Bell
renderBell={(unreadCount) => (
<div>
<span>{unreadCount}</span>
<BellIcon />
</div>
)}
/>
</Popover.Trigger>
<Popover.Portal>
<Popover.Content className="PopoverContent" sideOffset={5}>
<Notifications />
<Popover.Close className="PopoverClose" aria-label="Close">
<Cross2Icon />
</Popover.Close>
<Popover.Arrow className="PopoverArrow" />
</Popover.Content>
</Popover.Portal>
</Popover.Root>
</Inbox>
);
export default PopoverDemo;
Was this page helpful?
On this page