docs/platform/inbox/advanced-customization/customize-bell.mdx
The Novu Inbox includes a default bell icon that triggers the notification popover when clicked. You can use this bell as a standalone component or customize it to match your application's design system.
The Bell component displays Novu's default Inbox bell icon. It's designed to be used as a standalone trigger when you want to build your own custom Inbox UI, such as a custom popover or a full-page view.
By using Bell component, you separate the trigger (the icon) from the content (the notification list), giving you full control over the layout and behavior of your application's Inbox.
import { Inbox, Bell } from '@novu/react';
function BellComponent() {
return (
<Inbox
applicationIdentifier="YOUR_APPLICATION_IDENTIFIER"
subscriber="YOUR_SUBSCRIBER_ID"
>
<Bell/>
</Inbox>
);
}
export default BellComponent;
Replace the default bell icon that comes with the Inbox component with your own custom React component or a third-party UI library component to match your application's design. You can do this using the renderBell prop.
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;
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.total} notifications
</div>
);
}}
/>
);
}
export default CustomBell;
function CustomBell() {
return (
<Inbox
applicationIdentifier="YOUR_APPLICATION_IDENTIFIER"
subscriber="YOUR_SUBSCRIBER_ID"
renderBell={(unreadCount) => {
return (
<div className="bg-blue-300 p-4 inline-flex">
High severity $
{unreadCount.severity[SeverityLevelEnum.HIGH]}{' '}
notifications
</div>
);
}}
/>
);
}
export default CustomBell;