Skip to main content

AlertDisplay()

Home > @backstage/core-components > AlertDisplay

Displays alerts from AlertApi

Signature:

function AlertDisplay(props: AlertDisplayProps): React.JSX.Element | null;

Parameters

ParameterTypeDescription
propsAlertDisplayProps

Returns:

React.JSX.Element | null

Remarks

Shown as SnackBar at the center top of the page by default. Configurable with props.

Example

Here's some examples:

// This example shows the default usage, the SnackBar will show up at the top in the center and any transient messages will stay open for 5000ms
<AlertDisplay />

// With this example the SnackBar will show up in the bottom right hand corner and any transient messages will stay open for 2500ms
<AlertDisplay transientTimeoutMs={2500} anchorOrigin={{vertical: 'bottom', horizontal: 'right'}}/>

// If you want to just set the time a transientTimeoutMs, you can do that like this:
<AlertDisplay transientTimeoutMs={10000} />