Skip to main content

notif

The notif component displays positioned notification balloons (tooltips) anchored to an element.

info

A notif is a tooltip-like notification that is anchored to a specific element.
A toast is a notification that appears on the top right of the desktop.

Usage

Modular:

import { notif } from "/42/ui/layout/notif.js"
// Or
const { notif } = sys42

const myNotif = await notif(targetElement, "File saved!", {
picto: "check",
timeout: 3000,
})

Parameters

ParameterTypeDescription
elString/HTMLElementElement to anchor the notification to
messageString/PlanContent to display
optionsObjectConfiguration (see below)

Options

PropertyTypeDefaultDescription
pictoStringIcon identifier
timeoutNumberAuto-close delay in ms
positionableBooleantrueWhether to auto-position
tip

For simple temporary messages, consider using toast instead.