Overview
The notification center component creates an interactive mobile phone interface that displays notification alerts with smooth animations. When hovered or clicked, a notification slides down from the top of the phone screen with blur and scale effects, while a lock icon animates to indicate the unlock state.Features
- Animated mobile phone UI with realistic notification behavior
- Hover and click-triggered notification animations
- Customizable notification content (title, description, time)
- Dynamic lock/unlock indicator with color transitions
- Dark mode support with adaptive styling
- Smooth motion animations using Framer Motion
Use cases
- Product demos showcasing notification features
- Mobile app previews and marketing pages
- Interactive UI demonstrations
- Real-time alert system showcases
- Payment notification displays
Installation
Usage
Imports
The component uses the following dependencies:Props
The title text displayed at the bottom of the component card.
The description text displayed below the card title.
The title of the notification that appears on the phone screen.
The description text shown in the notification.
The timestamp displayed in the notification.
Examples
Payment notification
Message notification
Order notification
Customization
Animation variants
The component uses several motion variants that can be customized:phoneVariant: Controls the phone screen translation on hovernotificationVariant: Manages notification slide and blur effectslockVariant: Handles dark mode lock icon color changeslockLightVariant: Handles light mode lock icon color changesparentvariant: Controls stagger timing for child animations
Styling
The component uses Tailwind CSS classes and supports dark mode automatically. Key styling areas include:- Phone container with rounded borders and gradient backgrounds
- Notification card with backdrop blur and ring borders
- Icon wrappers with gradient backgrounds
- Gradient overlays at the bottom for text readability
The component displays a current time string that updates dynamically using
new Date().toLocaleTimeString().