Skip to content

Hud ​

A sl-hud component is an element that adds information or interactive elements on top of the main content.

It is used programmatically to display modals and notifications.

It does not require to add any markup to your HTML as a sl-hud element will be added to DOM automatically if needed.

Notifications ​

Methods ​

Add Notification ​

This method allows to add a notification.

Usage ​

InfoSuccessWarnError
typescript
import { addNotification } from 'slithe';

addNotification({
	type: 'info', // 'info'|'success'|'warn'|'error'
	icon: {
		name: 'info', // Icon name (added as a <sl-icon/> element)
		size: '16px' // Icon size
	},
	message: msg // Message displayed as a simple text
});