X Enterprises
nuxt-x-app

Notification

Bell icon with unread badge and a slide-over panel for listing and managing notifications.

Notification

The Notification category provides a two-component notification system. XANotificationBell is the header trigger; XANotificationSlideover is the panel. Both components connect to the shared useXNotifications composable, so state (open/closed, read/unread counts, notification list) is automatically synchronized.

Components

<XANotificationBell />

A button that displays the configured bell icon. When there are unread notifications, a red badge with the unread count overlays the top-right corner (capped at 99+). Clicking calls notifications.toggle() from useXNotifications.

<!-- In your header -->
<XANotificationBell
  icon="i-lucide-bell"
  size="sm"
  color="neutral"
  variant="ghost"
  :show-badge="true"
/>

Props

PropTypeDefaultDescription
iconString'i-lucide-bell'Icon name for the button
colorString'neutral'Button color
variantString'ghost'Button variant
sizeString'sm'Button size
showBadgeBooleantrueShow the unread count badge

<XANotificationSlideover />

A USlideover panel that lists all current notifications. Each item shows an icon, title, optional description, and relative time. A colored status dot reflects the notification's status field (success, warning, error, info). Read notifications are dimmed. Users can dismiss individual items or mark all as read via the footer controls.

<!-- Typically placed at the app root or layout level -->
<XANotificationSlideover
  title="Notifications"
  side="right"
  empty-message="You're all caught up"
  @click="handleNotificationClick"
/>

Props

PropTypeDefaultDescription
titleString'Notifications'Slide-over panel title
sideString'right'Slide direction: 'left' or 'right'
emptyMessageString'No notifications'Message shown when the list is empty

Events

EventPayloadDescription
clicknotificationEmitted when a notification item is clicked; also marks it as read

Setup

Both components rely on useXNotifications. Add notifications by calling the composable's methods from anywhere in your app:

const notifications = useXNotifications()

// Add a notification
notifications.add({
  id: 'deploy-complete',
  title: 'Deployment complete',
  description: 'v2.4.0 is live.',
  icon: 'i-lucide-rocket',
  status: 'success',
  time: 'Just now'
})

// Open the panel programmatically
notifications.open()

AI Context

category: Notification
package: "@xenterprises/nuxt-x-app"
use-when: >
  Add XANotificationBell to the application header and XANotificationSlideover
  once at the layout root. Use the useXNotifications composable to push
  notifications from anywhere — API responses, background jobs, socket
  events — and the components will reflect changes automatically. No
  additional wiring between the two components is required.
Copyright © 2026