Skip to content

Notification ​

Ekran chetidan sirgʻalib chiqadigan boy notification paneli. Sarlavha, tavsif, ikonkalar, amallar va toʻliq moslashtirishni qoʻllab-quvvatlaydi. Hover qilinganda kartochkalar kabi ustma-ust terilib turadi.

Basic ​

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

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

Title Only ​

Faqat sarlavhali notification uchun shunchaki string uzating.

vue
VxNotification.success('File uploaded successfully')

Position ​

Notificationlar 4 ta burchakda paydo boʻlishi mumkin. Koʻrish uchun bosing.

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

With Action ​

Foydalanuvchi bilan oʻzaro aloqa uchun amal tugmasini qoʻshing.

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 ​

Qoʻlda yopilmaguncha turadigan notificationlar uchun duration: 0 ni belgilang.

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

Custom Duration ​

Without Icon ​

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

onClick Callback ​

Butun notificationni bosiladigan qiling.

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

Update Existing ​

Jonli notificationni yangilash uchun id dan foydalaning.

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

Custom Style ​

Toʻliq moslashtiriladi: 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 sarlavhasi (majburiy yoki toʻgʻridan-toʻgʻri string uzating)
messagestring—Tavsif matni
type'success' | 'warning' | 'danger' | 'info' | 'default''default'Notification turi
durationnumber4500Avtomatik yopilish ms. 0 = doimiy
closablebooleantrueYopish tugmasini koʻrsatish
showIconbooleantrueTurga mos ikonkani koʻrsatish
iconComponent | string—Maxsus ikonka (SVG string)
position'top-right' | 'top-left' | 'bottom-right' | 'bottom-left''top-right'Burchak joylashuvi
showProgressbooleanfalseVaqt sanoq progress bari
dangerouslyUseHTMLStringbooleanfalseXabarni HTML sifatida render qilish
action{ text, onClick }—Amal tugmasi
idstring—Mavjud notificationni qayta ishlatish/yangilash
onClick() => void—Butun notification uchun click handler
backgroundstring—Maxsus fon
colorstring—Maxsus xabar matni rangi
titleColorstring—Maxsus sarlavha rangi
iconColorstring—Maxsus ikonka rangi
borderColorstring—Maxsus chegara rangi
progressColorstring—Maxsus progress bar rangi
borderRadiusstring—Maxsus border radius
shadowstring—Maxsus box-shadow
customClassstring—Qoʻshimcha CSS klass
customStyleCSSStyleDeclaration—Inline style’larni bekor qilish
onClose() => void—Yopilganda callback

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 */ })