Notification drawer

A notification drawer is a place where users can view and manage notifications that are generated by the system. It allows them to see a list of notifications without the need to navigate away from the current screen.

Examples

Basic

Notifications

3 unread
  • unread

    Info notification:Unread info notification title

    This is an info notification description.
    5 minutes ago
  • unread

    Danger notification:Unread danger notification title. This is a long title to show how the title will wrap if it is long and wraps to multiple lines.

    This is a danger notification description. This is a long description to show how the title will wrap if it is long and wraps to multiple lines.
    10 minutes ago
  • unread

    Danger notification:Unread danger notification title. This is a long title to show how the title will be truncated if it is long and will be shown in a single line.

    This is a danger notification description. This is a long description to show how the title will wrap if it is long and wraps to multiple lines.
    10 minutes ago
  • read

    Warning notification:Read warning notification title

    This is a warning notification description.
    20 minutes ago
  • read

    Success notification:Read success notification title

    This is a success notification description.
    30 minutes ago
  • read

    notification:Read (default) notification title

    This is a default notification description.
    35 minutes ago

Groups

Notifications

4 unread

  • unread

    Info notification:Unread info notification title

    This is an info notification description.
    5 minutes ago
  • unread

    Danger notification:Unread danger notification title. This is a long title to show how the title will wrap if it is long and wraps to multiple lines.

    This is a danger notification description. This is a long description to show how the title will wrap if it is long and wraps to multiple lines.
    10 minutes ago
  • read

    Warning notification:Read warning notification title

    This is a warning notification description.
    20 minutes ago
  • read

    Success notification:Read success notification title

    This is a success notification description.
    30 minutes ago

Lightweight

Notifications

  • unread

    Info notification:Info notification title w/action

    This is an info notification description.
    5 minutes ago
  • unread

    Danger notification:Danger notification title. This is a long title to show how the title will wrap if it is long and wraps to multiple lines.

    This is a danger notification description. This is a long description to show how the title will wrap if it is long and wraps to multiple lines.
    10 minutes ago
  • unread

    Warning notification:Warning notification title

    This is a warning notification description.
    20 minutes ago
  • unread

    Success notification:Success notification title

    This is a success notification description.
    30 minutes ago

Props

NotificationDrawer

*required
NameTypeDefaultDescription
childrenReact.ReactNodeContent rendered inside the notification drawer
classNamestringAdditional classes added to the notification drawer

NotificationDrawerBody

*required
NameTypeDefaultDescription
childrenReact.ReactNodeContent rendered inside the body of the notification drawer
classNamestring''Additional classes added to the notification drawer body

NotificationDrawerHeader

*required
NameTypeDefaultDescription
childrenReact.ReactNodeContent rendered inside the drawer
classNamestring''Additional classes for notification drawer header.
closeButtonAriaLabelstring'Close'Adds custom accessible text to the notification drawer close button.
countnumberNotification drawer heading count
customTextstringNotification drawer heading custom text which can be used instead of providing count/unreadText
onClose(event: KeyboardEvent | React.MouseEvent) => voidCallback for when close button is clicked
titlestring'Notifications'Notification drawer heading title
unreadTextstring'unread'Notification drawer heading unread text used in combination with a count

NotificationDrawerGroup

*required
NameTypeDefaultDescription
countrequirednumberNotification drawer group count
isExpandedrequiredbooleanAdds styling to the group to indicate expanded state
titlerequiredReact.ReactNodeNotification drawer group title
childrenReact.ReactNodeContent rendered inside the group
classNamestring''Additional classes added to the group
headingLevel'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6''h1'Sets the heading level to use for the group title. Default is h1.
isReadbooleanfalseAdds styling to the group to indicate whether it has been read
onExpand(event: any, value: boolean) => void(event: any, expanded: boolean) => undefined as anyCallback for when group button is clicked to expand
tooltipPosition| TooltipPosition | 'auto' | 'top' | 'bottom' | 'left' | 'right' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end' | 'left-start' | 'left-end' | 'right-start' | 'right-end'Position of the tooltip which is displayed if text is truncated
truncateTitlenumber0Truncate title to number of lines

NotificationDrawerGroupList

*required
NameTypeDefaultDescription
childrenReact.ReactNodeContent rendered inside the notification drawer list body
classNamestring''Additional classes added to the notification drawer list body

NotificationDrawerList

*required
NameTypeDefaultDescription
aria-labelstringAdds an accessible label to the notification drawer list.
childrenReact.ReactNodeContent rendered inside the notification drawer list body
classNamestring''Additional classes added to the notification drawer list body
isHiddenbooleanfalseAdds styling to the notification drawer list to indicate expand/hide state

NotificationDrawerListItem

*required
NameTypeDefaultDescription
childrenReact.ReactNodenullContent rendered inside the list item
classNamestring''Additional classes added to the list item
isHoverablebooleantrueModifies the list item to include hover styles on :hover
isReadbooleanfalseAdds styling to the list item to indicate it has been read
onClick(event: any) => void(event: React.MouseEvent) => undefined as anyCallback for when a list item is clicked
readStateScreenReaderTextstringVisually hidden text that conveys the current read state of the notification list item
tabIndexnumber0Tab index for the list item
variant'custom' | 'success' | 'danger' | 'warning' | 'info''custom'Variant indicates the severity level

NotificationDrawerListItemBody

*required
NameTypeDefaultDescription
childrenReact.ReactNodeContent rendered inside the list item body
classNamestring''Additional classes added to the list item body
timestampReact.ReactNodeList item timestamp

NotificationDrawerListItemHeader

*required
NameTypeDefaultDescription
titlerequiredstringNotification drawer list item title
childrenReact.ReactNodeActions rendered inside the notification drawer list item header
classNamestring''Additional classes for notification drawer list item header.
headingLevel'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6''h2'Sets the heading level to use for the list item header title. Default is h2.
iconReact.ReactNodenullAdd custom icon for notification drawer list item header
srTitlestringNotification drawer list item header screen reader title
tooltipPosition| TooltipPosition | 'auto' | 'top' | 'bottom' | 'left' | 'right' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end' | 'left-start' | 'left-end' | 'right-start' | 'right-end'Position of the tooltip which is displayed if text is truncated
truncateTitlenumber0Truncate title to number of lines
variant'success' | 'danger' | 'warning' | 'info' | 'custom''custom'Variant indicates the severity level

CSS variables

Expand or collapse columnSelectorVariableValue

View source on GitHub