Notification

Notifications provide important information inline with the content body within a view. These notifications do not self-dismiss and have the option to include a close “X”.

When to use

  • When another user of the app direct messages the current user.
  • When the app requires immediate action by the current user.
  • When the app must communicate actionable information from outside the current context.

Notification Basic Usage

Notification with all Available Kinds

Notification Closeable example

Notification in Full width

Notification with Overrides

Notification with Custom Dismiss

Overrides

Additionally, you can fully customize any part of the Notification through the overrides prop. The Notification consists of multiple subcomponents that are listed bellow and you can override each one of them. To help you identify the names of these subcomponents, you can highlight them through this selector:

Note: You should always use longhand CSS properties. Mixing shorthands and longhands will lead into strange behaviors!

Notification API

autoHideDuration number required

The number of milliseconds to wait before automatically dismissing a notification. This behavior is disabled when the value is set to 0.

children union required

Toast notification content. The children-as-function receives a dismiss method that can be called to dismiss the notification and can be used as a handler for an action inside the toast content.

One of
ChildrenArrayNode,
dismiss function required () => undefined
=> Node

closeable boolean = false

When set to true a close button is displayed and the notification can be dismissed by a user.

kind $Values<typeof KIND> required

Defines the type of notification.

$ValuesObject.freeze({ info: "info", positive: "positive", warning: "warning", negative: "negative" })

notificationType $Values<typeof TYPE> =

$ValuesObject.freeze({ inline: "inline", toast: "toast" })

onClose function required

A callback function called when a notification is dismissed.

() => mixed

onBlur function required

Event => mixed

onFocus function required

Event => mixed

onMouseEnter function required

Event => mixed

onMouseLeave function required

Event => mixed

"data-baseweb" string

overrides object required

Body { component: ?ComponentType<<T>>, props: ?{}, style: ?{} | ({}) => ?{} }<<T>> | ComponentType<<T>>
$kind required $ValuesObject.freeze({ info: "info", positive: "positive", warning: "warning", negative: "negative" })
$type required $ValuesObject.freeze({ inline: "inline", toast: "toast" })
$closeable boolean required
$isRendered boolean required
$isVisible boolean required
$style nullable Object
CloseIcon { component: ?ComponentType<<T>>, props: ?{}, style: ?{} | ({}) => ?{} }<<T>> | ComponentType<<T>>
$kind required $ValuesObject.freeze({ info: "info", positive: "positive", warning: "warning", negative: "negative" })
$type required $ValuesObject.freeze({ inline: "inline", toast: "toast" })
$closeable boolean required
$isRendered boolean required
$isVisible boolean required
$style nullable Object

key Key required

Key