Download the PHP package rifrocket/filament-alert-box without Composer
On this page you can find all versions of the php package rifrocket/filament-alert-box. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download rifrocket/filament-alert-box
More information about rifrocket/filament-alert-box
Files in rifrocket/filament-alert-box
Package filament-alert-box
Short Description A modern, customizable alert box plugin for FilamentPHP with render hooks support. Create beautiful alerts with a fluent, chainable API across 4 different layout types.
License MIT
Homepage https://github.com/rifrocket/filament-alert-box
Informations about the package filament-alert-box
Alert Box
A modern, customizable alert box plugin for FilamentPHP with render hooks support. Create beautiful alerts with a fluent, chainable API across 4 different card styles.
Features
- 🎨 4 Beautiful Card Styles - Banner, Card with Border, Modern Card, and Minimalist
- 🔗 Fluent Chainable API -
AlertBox::make('Title')->success()->modernCard()->show() - 🎯 FilamentPHP Render Hooks - Perfectly integrated with Filament's architecture
- 💾 In-Memory Storage - No database or session dependencies
- 🎭 Auto-Hide & Permanent - Configure timeout or make alerts persistent
- 🎪 Customizable Icons & Colors - Full control over appearance with 5 icon sizes (xs, s, m, lg, xl)
- ⚡ Zero Configuration - Works out of the box
- 📱 Responsive Design - Works on all screen sizes
Installation
Install the package via Composer:
Register the plugin in your Panel provider:
Optionally, publish the views:
Usage
Basic Usage
Card Styles
Choose from 4 beautiful card styles:
Position-Based Methods
Use position-specific methods to control WHERE alerts appear:
Combining Style and Position
Mix card styles with positions for complete control:
Alert Types
Advanced Configuration
Auto-Hide vs Permanent
Quick Static Methods
Convenience methods for rapid alert creation:
API Reference
AlertBuilder Methods
| Method | Description | Example |
|---|---|---|
make(string $title = null) |
Create new alert builder | AlertBox::make('Title') |
title(string $title) |
Set alert title | ->title('Alert Title') |
message(string $message) |
Set alert message (alias for description) | ->message('Alert message') |
description(string $description) |
Set alert description | ->description('Alert description') |
cardStyle(int $style) |
Set card style (1-4) | ->cardStyle(2) |
bannerStyle() |
Simple banner style | ->bannerStyle() |
cardWithBorder() |
Card with border style | ->cardWithBorder() |
modernCard() |
Modern card style | ->modernCard() |
minimalistStyle() |
Minimalist style | ->minimalistStyle() |
icon(string $icon) |
Set alert icon | ->icon('heroicon-o-check') |
noIcon(bool $state = true) |
Disable alert icon | ->noIcon() |
iconColor(string $color) |
Set icon color | ->iconColor('#10b981') |
iconSize(string $size) |
Set icon size (xs, s, m, lg, xl) | ->iconSize('lg') |
iconXS() |
Set extra small icon | ->iconXS() |
iconS() |
Set small icon | ->iconS() |
iconM() |
Set medium icon (default) | ->iconM() |
iconLG() |
Set large icon | ->iconLG() |
iconXL() |
Set extra large icon | ->iconXL() |
titleColor(string $color) |
Set title color | ->titleColor('#059669') |
descriptionColor(string $color) |
Set description color | ->descriptionColor('#6b7280') |
success() |
Set as success alert | ->success() |
danger() |
Set as danger alert | ->danger() |
error() |
Alias for danger | ->error() |
warning() |
Set as warning alert | ->warning() |
info() |
Set as info alert | ->info() |
canBeClose(bool $closeable = true) |
Set closeable | ->canBeClose(false) |
autoDisappear(int $seconds) |
Auto-hide timeout | ->autoDisappear(10) |
permanent(bool $permanent = true) |
Make permanent | ->permanent() |
classes(string $classes) |
Add CSS classes | ->classes('my-class') |
style(string $style) |
Add inline styles | ->style('color: red;') |
position(string $position) |
Set custom position | ->position('custom-hook') |
renderHook(string $hook) |
Set render hook | ->renderHook(PanelsRenderHook::PAGE_START) |
show() |
Display the alert | ->show() |
Position Methods
| Method | Description | Hook |
|---|---|---|
pageHeaderAfter() |
After page header widgets | PAGE_HEADER_WIDGETS_AFTER |
pageStart() |
At page start | PAGE_START |
sidebarNavEnd() |
End of sidebar navigation | SIDEBAR_NAV_END |
topbarStart() |
Start of topbar | TOPBAR_START |
pageEnd() |
At page end | PAGE_END |
footer() |
In footer | FOOTER |
Manager Methods
Card Style Previews
Style 1: Simple Banner
Clean, simple banner-style alert with a colored left border. Perfect for basic notifications.
Style 2: Card with Border
Enhanced card with a full border, more padding, and refined styling. Great for important messages.
Style 3: Modern Card
Premium card design with gradient top border, enhanced shadows, and sophisticated styling. Best for key announcements.
Style 4: Minimalist
Compact, clean design with minimal styling. Perfect for subtle notifications and inline messages.
Customization
Publishing Views
The alert styles use Tailwind CSS utility classes exclusively. You can customize the appearance by publishing and modifying the Blade views at resources/views/vendor/alert-box/.
Custom Icons
Use any Heroicon or custom icon with different sizes:
Icon Sizes
Choose from 5 different icon sizes:
Requirements
- PHP 8.1+
- FilamentPHP 3.0+
- Laravel 10.0+ or 11.0+
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
The MIT License (MIT). Please see License File for more information.
Credits
- Mohammad Arif
- All Contributors
Support
If you find this package helpful, please consider starring the repository!