sanzgrapher/swippable-notification
A Filament package that adds swipe-to-close functionality to all Filament notifications - both popup toast notifications and database notifications. Swipe left or right to dismiss with a smooth animation.

composer require sanzgrapher/swippable-notification
Register the plugin in your Filament PanelProvider:
use Sanzgrapher\SwippableNotification\SwippableNotification;
class AdminPanelProvider extends PanelProvider
{
public function panel(Panel $panel): Panel
{
return $panel
->default()
->id('admin')
->path('admin')
// ... other configuration ...
->plugins([
SwippableNotification::make(),
]);
}
}
That's it! All Filament notifications will now support swipe-to-close functionality.
Standard Filament notifications that appear as toasts:
Notification::make()
->title('Success!')
->body('Your action was completed successfully.')
->success()
->send();
Filament database notifications in the notification modal:
use Filament\Notifications\Notification;
$recipient = auth()->user();
Notification::make()
->title('Important Update')
->body('You have a new message')
->success()
->persistent()
->sendToDatabase($recipient);
The package automatically:
.fi-no-notification for popups)[x-data*="notificationComponent"])On Desktop:
On Mobile:
.swippable-notification-dragging applied to element.swippable-notification-closing applied to elementTo change the swipe threshold, edit init-swippable.js:
threshold: 80, // pixels needed to trigger close (increase for less sensitive)
Adjust how quickly the notification fades while dragging:
this.el.style.opacity = `${Math.max(0, 1 - Math.abs(this.currentX) / 300)}`;
// Adjust 300 for different fade speeds
PanelProviderMake sure you're using Filament's DatabaseNotification class, not Laravel's standard notifications.
Make sure your CSS is loading properly. Check browser console for any CSS errors.
This package is designed to be non-invasive and work alongside other Filament plugins. It only adds event listeners to notifications without modifying their structure.
use Filament\Notifications\Notification;
Notification::make()
->title('Success!')
->body('Your record was saved.')
->success()
->send();
use Filament\Notifications\DatabaseNotification;
DatabaseNotification::create([
'user_id' => auth()->id(),
'title' => 'New Message',
'body' => 'You have received a new message.',
]);
Both will have swipe-to-close functionality automatically!
MIT
Author: Narayan Dhakal (sanzgrapher) Email: narayandhakal09@duck.com
How can I help you explore Laravel packages today?