Skip to content

Notification ​

A rich notification panel that slides in from the edge of the screen. Supports title, description, icons, actions, and full customization. Stacks like cards on hover.

Basic ​

vue
<script setup>
import { VxNotification } from 'veloxui'

VxNotification.success('Saved', {
  message: 'Your changes have been saved.',
})
</script>

Title Only ​

Pass just a string for a title-only notification.

vue
VxNotification.success('File uploaded successfully')

Position ​

Notifications can appear in 4 corners. Click to preview.

vue
VxNotification.info('Title', {
  message: 'Description',
  position: 'bottom-left',
})

With Action ​

Add an action button for user interaction.

vue
VxNotification({
  title: 'Update Available',
  message: 'Version 2.4.0 is ready.',
  type: 'info',
  action: {
    text: 'Update Now',
    onClick: () => installUpdate(),
  },
})

Progress Bar ​

vue
VxNotification.info('Downloading', {
  message: 'Preparing file...',
  showProgress: true,
  duration: 5000,
})

HTML Content ​

vue
VxNotification.info('New Comment', {
  message: '<strong>Alice</strong> commented...',
  dangerouslyUseHTMLString: true,
})

Persistent ​

Set duration: 0 for notifications that stay until manually closed.

vue
VxNotification.warning('Action Required', {
  message: 'Verify your email.',
  duration: 0,
})

Custom Duration ​

Without Icon ​

vue
VxNotification({ title: 'Plain', showIcon: false })

onClick Callback ​

Make the entire notification clickable.

vue
VxNotification.info('New message', {
  message: 'Click to view',
  onClick: () => router.push('/inbox'),
})

Update Existing ​

Use id to update a live notification.

vue
VxNotification({ id: 'deploy', title: 'Building...', type: 'info', duration: 0 })
// later...
VxNotification({ id: 'deploy', title: 'Deployed!', type: 'success', duration: 3000 })

Custom Style ​

Fully customizable: background, color, titleColor, iconColor, borderColor, borderRadius, shadow, progressColor.

vue
VxNotification({
  title: 'Custom',
  message: 'Fully styled.',
  background: '#18181b',
  titleColor: '#fafafa',
  color: '#a1a1aa',
  iconColor: '#4ade80',
  borderColor: '#27272a',
})

Close All ​

vue
VxNotification.closeAll()

Promise Support ​

vue
VxNotification.success('Saved', { duration: 2000 })
  .then(() => VxNotification.info('Syncing...'))

API ​

VxNotification(options) ​

ParamTypeDefaultDescription
titlestring—Notification title (required, or pass string directly)
messagestring—Description text
type'success' | 'warning' | 'danger' | 'info' | 'default''default'Notification type
durationnumber4500Auto-close ms. 0 = persistent
closablebooleantrueShow close button
showIconbooleantrueShow type icon
iconComponent | string—Custom icon (SVG string)
position'top-right' | 'top-left' | 'bottom-right' | 'bottom-left''top-right'Corner position
showProgressbooleanfalseVisual countdown bar
dangerouslyUseHTMLStringbooleanfalseRender message as HTML
action{ text, onClick }—Action button
idstring—Reuse/update existing notification
onClick() => void—Click handler for entire notification
backgroundstring—Custom background
colorstring—Custom message text color
titleColorstring—Custom title color
iconColorstring—Custom icon color
borderColorstring—Custom border color
progressColorstring—Custom progress bar color
borderRadiusstring—Custom border radius
shadowstring—Custom box-shadow
customClassstring—Extra CSS class
customStyleCSSStyleDeclaration—Inline style overrides
onClose() => void—Callback when closed

Methods ​

ts
VxNotification.success(title, options?)
VxNotification.warning(title, options?)
VxNotification.danger(title, options?)
VxNotification.info(title, options?)
VxNotification.closeAll()
VxNotification.config({ max: 5 })

Return Value ​

ts
const handle = VxNotification.success('Done')
handle.close()
handle.update({ title: 'Updated', type: 'info' })
handle.then(() => { /* after close */ })