Skip to main content

NotificationCardHeaderShell

The <NotificationCardHeaderShell> is part of a group of components that allow full customization of the notification card. The <NotificationCardHeaderShell> allows creating a custom header while keeping the built-in Notification context menu features such as "Mark Read" or "Snooze".

Props

PropTypeRequiredDefault valueDescription
notificationINotificationNoThe Notification to be displayed. The <NotificationCenter> and <NotificationToasts> components will pass this value in at run time
uiContext"center"|"toasts"NoThe context in which the custom notification card will be rendered. The <NotificationCenter> and <NotificationToasts> components will pass this value in at run time
removeNotificationFunctionNoThe function that gets called when removing a toast from view. The <NotificationCenter> and <NotificationToasts> components will pass this value in at run time.

<NotificationCardHeaderShell> accepts child components to render.



The <NotificationCardHeaderShell> accepts child components to render. If there are no children, the default Finsemble notification card header will be rendered.

Usage

import {
NotificationCardPropType,
NotificationCardShell,
NotificationCardHeaderShell,
NotificationCardBodyShell
} from "@finsemble/finsemble-ui/react/components/notifications";

export const CustomNotificationCard: React.FunctionComponent<NotificationCardPropType> = (props) => {
return (
<NotificationCardShell {...props}>
<NotificationCardHeaderShell {...props}>
{/*Custom NotificationCardHeader Child Components Go here... No children will render the default header*/}
<div>{props.notification.title}</div>
</NotificationCardHeaderShell>
<NotificationCardBodyShell {...props} />
</NotificationCardShell>
);
};

NotificationCardShell, NotificationCardBodyShell