Notification
# FxNotification
A global notification that appears as a floating element at the corner of the page.
# Methods
Calling Notification or this.$notify returns the current Notification instance. To manually close the instance, call its close method.
| Method | Description |
|---|---|
| close | Close the current Notification |
# Basic Usage
General purpose notification bar.
# With Type
Displays system messages with icons for different states: success, warning, info, and error.
# Custom Position
Allows notifications to appear from any corner of the screen.
# With Offset
Adds offset to the notification position.
# Using HTML Fragments
The message property supports HTML fragments.
:::warning
While the message property supports HTML fragments, dynamically rendering arbitrary HTML on websites is dangerous as it may lead to XSS attacks (opens new window). When dangerouslyUseHTMLString is enabled, ensure the message content is trusted. Never assign user-submitted content to the message property.
:::
# Hide Close Button
Option to hide the close button.
# Global Method
FxUI adds the global method $notify to Vue.prototype, making it available in Vue instances as shown throughout this page.
# Options
| Parameter | Description | Type | Options | Default |
|---|---|---|---|---|
| title | Title | string | — | — |
| message | Content text | string/Vue.VNode | — | — |
| dangerouslyUseHTMLString | Whether message is treated as HTML fragment | boolean | — | false |
| type | Notification type | string | success/warning/info/error | — |
| iconClass | Custom icon class (overridden by type) | string | — | — |
| customClass | Custom class name | string | — | — |
| duration | Display duration in ms (0 means no auto-close) | number | — | 4500 |
| position | Custom position | string | top-right/top-left/bottom-right/bottom-left | top-right |
| showClose | Whether to show close button | boolean | — | true |
| onClose | Callback when closed | function | — | — |
| onClick | Callback when clicked | function | — | — |
| offset | Offset distance (all instances should share same offset) | number | — | 0 |