
Security News
How Enterprise Security Is Adapting to AI-Accelerated Threats
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.
interstellar-ui-messages
Advanced tools
interstellar-ui-messagesThe interstellar-ui-messages module is part of the Interstellar Module System.
This module provides common UI components.
Quick start to developing in the Interstellar eco-system:
- Read
Getting starteddoc.- Install
interstellar-workspace.- Contribute to our open-source modules or develop your own.
Alert classAlert object represents single alert notification which can be attached to an AlertGroup.
import {Alert} from 'interstellar-ui-messages';
let alert = new Alert({
title: 'Password is incorrect',
text: 'Make sure you are using a correct password to login.`,
type: Alert.TYPES.ERROR,
dismissible: false // default true
});
There are 4 possible Alert.TYPES:
Alert.TYPES.SUCCESSAlert.TYPES.INFOAlert.TYPES.WARNINGAlert.TYPES.ERRORAlerts with dismissible parameter set to true will show a little × icon to allow user to dismiss an alert.
Check AlertGroup docs for information on how to display an Alert.
TODO
AlertGroup classAlertGroup represents a place in your UI where alerts are displayed. Your application/widget can have multiple AlertGroups.
Once you create a new alert group and register in Alerts service you can show your first Alert.
import {Alert, AlertGroup} from 'interstellar-ui-messages';
let alertGroup = new AlertGroup();
Alerts.registerGroup(alertGroup);
let alert = new Alert({
title: 'Password is incorrect',
text: 'Make sure you are using a correct password to login.`,
type: Alert.TYPES.ERROR,
dismissible: false // default true
});
alertGroup.show(alert);
You can clear all alerts in existing group using clear method:
alertGroup.clear();
To display your alert group in your UI use <interstellar-ui-messages-alerts> widget.
Toast classToast object represents single toast message that can be displayed using Toast service.
let toast = new Toast('Transaction sent!');
You can pass a second parameter with number of miliseconds your toast should be visible:
let toast = new Toast('Transaction sent!', 5000); // 5 seconds
Toast will be visible for 2 seconds by default.
interstellar-ui-messages.Alerts serviceAlerts service allows you to register your AlertGroup.
import {AlertGroup} from 'interstellar-ui-messages';
let alertGroup = new AlertGroup();
Alerts.registerGroup(alertGroup);
You must register your alert group before you can use it within your application or widget.
You can also get previously registered group by it's ID:
let alertGroup = Alerts.getGroup(groupId);
interstellar-ui-messages.Toasts serviceUse Toasts service to show your Toast:
import {Toast} from 'interstellar-ui-messages';
@Widget('send', 'SendWidgetController', 'interstellar-network-widgets/send-widget')
@Inject('interstellar-ui-messages.Toasts')
export default class SendWidgetController {
constructor(Toasts) {
this.Toasts = Toasts;
}
send() {
// Send transaction
let toast = new Toast('Transaction sent!');
this.Toasts.show(toast);
}
}
Remember you have to place <interstellar-ui-messages-toast> widget somewhere in you application. Otherwise your Toast won't appear.
<interstellar-ui-messages-alerts> widgetUse <interstellar-ui-messages-alerts> widget to display AlertGroup in your UI. This widget accepts one parameter: group which represents AlertGroup object you want to display.
import {AlertGroup} from 'interstellar-ui-messages';
@Widget('send', 'SendWidgetController', 'interstellar-network-widgets/send-widget')
@Inject('interstellar-ui-messages.Alerts')
export default class SendWidgetController {
constructor(Alerts) {
this.alertGroup = new AlertGroup();
Alerts.registerGroup(this.alertGroup);
}
}
<div ng-controller="interstellar-network-widgets.SendWidgetController as widget">
<interstellar-ui-messages-alerts group="widget.alertGroup"></interstellar-ui-messages-alerts>
</div>
<interstellar-ui-messages-toast> widgetUse <interstellar-ui-messages-toast> widget to display toasts in your UI. There should be only one, global toast widget in your application.
<interstellar-ui-messages-toast></interstellar-ui-messages-toast>
FAQs
`interstellar-ui-messages` ==========================
The npm package interstellar-ui-messages receives a total of 10 weekly downloads. As such, interstellar-ui-messages popularity was classified as not popular.
We found that interstellar-ui-messages demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.