The notification inbox has a light (default), flat and classic theme, and can be customized to match your site's style. You can do so by overriding default theme definitions.
In the following example, we show how to change the color of the bell icon, the background color, border radius and font of the header of the notification inbox.
{(props) => (
)}
import React from 'react';
import MagicBell, { FloatingNotificationInbox } from '@magicbell/magicbell-react';
export default function Notifications() {
// Your custom theme definition
const theme = {
icon: { borderColor: '#2c73d2' },
header: {
fontFamily: 'Arial',
backgroundColor: '#c34a36',
textColor: '#fff',
borderRadius: '2px',
},
footer: { backgroundColor: '#c34a36' },
};
return (
{(props) => }
);
}
The bell icon
The bell icon is an SVG image, you can change the size and color of it.
Property name | Default value |
---|---|
borderColor | #5225C1 |
width | 24px |
The header
You can change the background color and its opacity, the text color and size and the border radius among others.
This is a complete list of the customizable settings:
Property name | Default value |
---|---|
backgroundColor | #FFFFFF |
backgroundOpacity | 1 |
borderColor | #EFEEF1 |
borderRadius | 16px |
fontFamily | Inter, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif, -apple-system, system |
fontSize | 15px |
fontWeight | 400 |
padding | 16px |
textAlign | left |
textColor | #5225C1 |
textTransform | none |
The unseen badge
This element shows the number of unseen notifications for the current user. You can change the background color and opacity, the border radius, and the font size among others. The size of this element is relative to the size of the bell.
This is a complete list of the customizable setttings:
Property name | Default value |
---|---|
backgroundColor | #F80808 |
backgroundOpacity | 1 |
borderColor | white |
borderRadius | 4px |
fontFamily | Inter, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif, -apple-system, system |
fontSize | 9px |
fontWeight | 400 |
padding | 2px 3px |
textAlign | center |
textColor | white |
textTransform | none |
The footer
You can change the background color and its opacity, the text color and size and the border radius among others.
This is a complete list of the customizable setttings:
Property name | Default value |
---|---|
backgroundColor | #FFFFFF |
backgroundOpacity | 1 |
borderColor | #EFEEF1 |
borderRadius | 16px |
fontFamily | Inter, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif, -apple-system, system |
fontSize | 12px |
fontWeight | 400 |
padding | 8px 16px |
textAlign | left |
textColor | #5225C1 |
textTransform | none |
The notification
The style of a notification depends on its state. It can be unseen, unread or read. Read state is the default state. Unseen and unread states override properties of the default state.
This is the default style of a read notification:
Property name | Default value |
---|---|
backgroundColor | #FFFFFF |
backgroundOpacity | 1 |
borderRadius | 16px |
fontFamily | Inter, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif, -apple-system, system |
fontSize | 12px |
fontWeight | 400 |
hover | object |
hover.backgroundColor | #F2EDFC |
hover.backgroundOpacity | 1 |
margin | 8px |
padding | 16px 8px |
state | object |
state.color | transparent |
textAlign | left |
textColor | #3A424D |
textTransform | none |
title | object |
title.fontFamily | inherit |
title.fontSize | inherit |
title.fontWeight | 600 |
title.textColor | #181B20 |
The unseen notification
This is the default style of an unseen notification. Note that the unseen style inherits properties from the default notification style. When you override these styles, defining the differences compared to default is sufficient.
Property name | Default value |
---|---|
backgroundColor | #F8F5FF |
backgroundOpacity | 1 |
borderRadius | 16px |
fontFamily | Inter, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif, -apple-system, system |
fontSize | 12px |
fontWeight | 400 |
hover | object |
hover.backgroundColor | #F2EDFC |
hover.backgroundOpacity | 1 |
margin | 8px |
padding | 16px 8px |
state | object |
state.color | #5225C1 |
textAlign | left |
textColor | #3A424D |
textTransform | none |
title | object |
title.fontFamily | inherit |
title.fontSize | inherit |
title.fontWeight | 600 |
title.textColor | #181B20 |
The unread notification.
And this is the default style of an unread (but seen) notification. Note that the unread style inherits properties from the default notification style. When you override these styles, defining the differences compared to default is sufficient.
Property name | Default value |
---|---|
backgroundColor | #F8F5FF |
backgroundOpacity | 1 |
borderRadius | 16px |
fontFamily | Inter, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif, -apple-system, system |
fontSize | 12px |
fontWeight | 400 |
hover | object |
hover.backgroundColor | #F2EDFC |
hover.backgroundOpacity | 1 |
margin | 8px |
padding | 16px 8px |
state | object |
state.color | #5225C1 |
textAlign | left |
textColor | #3A424D |
textTransform | none |
title | object |
title.fontFamily | inherit |
title.fontSize | inherit |
title.fontWeight | 600 |
title.textColor | #181B20 |
Dark theme example
By combining the above options you can get a huge variety of themes. For example, this is a definition for a dark theme:
{(props) => (
)}