Skip to main content
Version: v3

NotificationApi

API for notifications in the Rancher UI Notification Center

  • notification Example

Methods​

send()​

send(
level,
title,
message?,
config?): Promise<string>;

Sends a notification to the Rancher UI Notification Center

Example:

import { NotificationLevel } from '@shell/types/notifications';

this.$shell.notification.send(NotificationLevel.Success, 'Some notification title', 'Hello world! Success!', {})

For usage with the Composition API check usage guide here.

Parameters​

level​

NotificationLevel

The level specifies the importance of the notification and determines the icon that is shown in the notification

title​

string

The notification title

message?​

string

The notification message to be displayed

config?​

NotificationConfig

Notifications configuration object

Returns​

Promise<string>

notification ID


updateProgress()​

updateProgress(notificationId, progress): void;

Update notification progress (Only valid for notifications of type Task)

Example:

this.$shell.notification.updateProgress('some-notification-id', 80)

For usage with the Composition API check usage guide here.

Parameters​

notificationId​

string

Unique ID for the notification

progress​

number

Progress (0-100) for notifications of type Task

Returns​

void