Import
import { useNotifications } from '@meteorack/modules-sdk-ui/notifications';How To Use It
- Call notify({ type, message }) to show a notification. Returns the notification id for manual dismissal.
Works Well With
Methods
notifications: Notification[]All active notifications.
notify(options: NotifyOptions): stringShow a notification. Returns its id.
dismiss(id: string): voidDismiss by id.
dismissAll(): voidDismiss all notifications.
Example
bootstrap.php
import { useNotifications } from '@meteorack/modules-sdk-ui/notifications';
function SaveButton() {
const { notify } = useNotifications();
return (
<button onClick={() => notify({ type: 'success', message: 'Settings saved.' })}>
Save
</button>
);
}