sanzgrapher/swippable-notification
composer require sanzgrapher/swippable-notification
Sanzgrapher\SwippableNotification\SwippableNotification::make() to your PanelProvider's plugins() array.
->plugins([
SwippableNotification::make(),
])
Notification::make()->success()) and swipe left/right to dismiss.Replace traditional click-to-dismiss notifications with swipe gestures in:
Zero-Configuration Integration:
Customizing Swipe Behavior (Advanced):
SwippableNotification::make()
->swipeThreshold(100) // Custom threshold in pixels
->swipeDirection('left') // Restrict to left-only swipes
php artisan vendor:publish --tag=swippable-notification-assets
Conditional Activation:
data-swippable="false" attribute:
Notification::make()
->success()
->extraAttributes(['data-swippable' => 'false'])
Mobile-First Development:
Notification::make() in widgets (e.g., Resources\Pages\Dashboard.php).Notification::make() in API controllers for user feedback.filament-notifications).Threshold Sensitivity:
Conflicting CSS:
z-index, pointer-events) to prevent swipe interference.touch-action: none conflicts).Database Notifications:
Notifications widget.Edge Cases:
aria-live regions.npm run dev if customizing CSS/JS after publishing assets.Custom Animations: Modify the plugin’s JavaScript to change swipe animations (e.g., fade-out instead of slide).
// resources/js/swippable-notification.js
this.element.style.transition = 'opacity 0.3s';
Event Hooks: Listen for swipe events globally:
document.addEventListener('swippable:swiped', (e) => {
console.log('Swiped notification:', e.detail.notificationId);
});
Server-Side Logic:
Use the swiped event to trigger server actions (e.g., log dismissals):
// In a Filament resource/page
$this->registerScripts([
'swippable-notification' => 'path/to/custom-script.js',
]);
Localization: Override cursor feedback text (e.g., "Drag to dismiss") via language files:
// resources/lang/en/swippable.php
{
"drag_to_dismiss": "Swipe to close"
}
How can I help you explore Laravel packages today?