Ruixen Pro is now live.50+ premium components, templates, blocks, and lifetime updates.

Command Palette

Search for a command to run...

Docs
Notification

Notification

Spring toast stack with drag-to-dismiss, rubber-band physics, and glass morphism.

Installation

Props

PropTypeDefaultDescription
itemsNotificationItem[]DEFAULT_ITEMSArray of notification items
onDismiss(id: string) => voidundefinedCallback when a toast is swiped
soundbooleantrueEnable micro noise-burst on dismiss

NotificationItem Interface

interface NotificationItem {
  id: string;
  title: string;
  body: string;
  time: string;
  type?: "default" | "success" | "error";
}

Features

  • Spring Toast Stack: Newest floats on top, older compress below with diminishing scale and blur
  • Drag-to-Dismiss: Swipe the top card right to dismiss with spring exit animation
  • Rubber-Band Physics: Resistance when dragging left past the boundary
  • Glass Morphism: Backdrop blur with light/dark theme support via CSS custom properties
  • Audio Feedback: Soft noise-burst tick on each dismissal
  • Controlled/Uncontrolled: Works with or without external state management

Usage

import { Notification } from "@/components/ruixen/notification";
 
export default function Example() {
  return <Notification />;
}