Installation:
composer require hammadzafar05/mobile-bottom-nav
No additional configuration or publishing is required.
Register the Plugin:
Add the plugin to your Filament panel provider (e.g., PanelServiceProvider):
public function panel(Panel $panel): Panel
{
return $panel
->plugins([
\Hammadzafar05\MobileBottomNav\MobileBottomNav::make(),
// ... other plugins
]);
}
First Use Case:
Ctrl+Shift+M).Automatic Navigation Integration:
Navigation::items()) and mirrors those items in the bottom bar.Dashboard page and a Posts resource, both will appear as tappable icons in the bottom nav.php artisan vendor:publish --provider="Hammadzafar05\MobileBottomNav\MobileBottomNavServiceProvider" --tag="mobile-bottom-nav-config"
Then modify config/mobile-bottom-nav.php to specify nav_items.Responsive Behavior:
768px).breakpoint config option to adjust:
MobileBottomNav::make()->configureUsing(function (MobileBottomNav $plugin) {
$plugin->breakpoint = 992; // Show on larger screens
});
Sidebar Integration:
'sidebar_integration' => true,
Dynamic Badges:
Navigation::items([
NavigationItem::make('Dashboard')
->icon('heroicon-o-home')
->badge(5) // Shows a "5" badge
->url(fn () => route('filament.admin.pages.dashboard')),
]);
Dark Mode Support:
colors config:
'colors' => [
'light' => ['background' => '#f8fafc', 'icon' => '#475569'],
'dark' => ['background' => '#2d3748', 'icon' => '#e2e8f0'],
],
Conditional Item Visibility:
mobile_hidden flag to navigation items:
NavigationItem::make('Settings')
->mobileHidden(true)
->url(...),
Custom Icons:
NavigationItem::make('Reports')
->icon('heroicon-o-chart-bar')
->url(...),
Programmatic Control:
window.MobileBottomNav.hide(); // Extend the package’s JS API if needed
window.MobileBottomNav object for basic control.Localization:
NavigationItem::make(__('filament-bottom-nav.dashboard'))
->url(...),
Navigation Registry Mismatch:
Navigation::items(). Ensure your navigation items are registered before the panel loads.PanelServiceProvider or NavigationServiceProvider is correctly configured.Safe Area Insets Not Working:
env(safe-area-inset-bottom) may be overridden..filament-mobile-bottom-nav {
padding-bottom: env(safe-area-inset-bottom);
}
Duplicate Items:
mobileHidden(true) on sidebar-only items or vice versa.Performance on Large Navs:
'max_items' => 5, // Show only top 5 items
Inspect the Rendered HTML:
F12) and check if the bottom nav renders:
<div class="filament-mobile-bottom-nav">...</div>
panel() and no JavaScript errors block it.Check JavaScript Console:
MobileBottomNav is not defined
resources/js/filament/app.js or your panel’s JS bundle).Disable Caching:
php artisan filament:cache:clear
Custom Templates:
php artisan vendor:publish --provider="Hammadzafar05\MobileBottomNav\MobileBottomNavServiceProvider" --tag="mobile-bottom-nav-views"
resources/views/vendor/mobile-bottom-nav.blade.php.Add Custom Items:
Navigation::macro('addMobileBottomNavItem', function ($item) {
$this->items[] = $item->mobileHidden(false);
});
Event Listeners:
MobileBottomNav::make()->onItemClick(function (string $url) {
// Log or analytics
});
Dark Mode Overrides:
'force_dark_mode' => env('MOBILE_NAV_DARK_MODE', false),
<button aria-label="{{ $item['label'] }}">
{{ $item['icon'] }}
</button>
How can I help you explore Laravel packages today?