UINotification
UINotification
A notification component for displaying global messages.
<template> <UIButton @click="showNotification">Show Notification</UIButton></template>
<script setup lang="ts">import { useNotification } from '@gohighlevel/ghl-ui'
const notification = useNotification()
const showNotification = () => { notification.success({ title: 'Success', content: 'Operation completed successfully', duration: 4500, placement: 'topRight', closable: true, onClose: () => { console.log('Notification closed') } })}</script>Methods
success(config): Show success notificationerror(config): Show error notificationinfo(config): Show info notificationwarning(config): Show warning notificationopen(config): Show custom notificationclose(key: string): Close notification by keydestroy(): Close all notifications
Config Options
title(string): Notification titlecontent(string | VNode): Notification contentduration(number): Display duration in millisecondsplacement(‘topLeft’ | ‘topRight’ | ‘bottomLeft’ | ‘bottomRight’): Positionclosable(boolean): Show close buttoncloseIcon(VNode): Custom close iconicon(VNode): Custom notification iconkey(string): Unique identifierclass(string): Custom class namestyle(object): Custom style objectonClick(function): Click callbackonClose(function): Close callback
Slots (when used as component)
icon: Custom icon contenttitle: Custom title contentdefault: Custom contentaction: Custom action content