emuniq/filament-collapsible-subnav
最新稳定版本:v1.5.0
Composer 安装命令:
composer require emuniq/filament-collapsible-subnav
包简介
A Filament v3 & v4 plugin for collapsible sub-navigation sidebar.
README 文档
README
A Filament v3 & v4 plugin that adds a collapsible toggle to sub-navigation sidebars only. Perfect for resource pages with multiple tabs or sections using ->subNavigationPosition(SubNavigationPosition::Start).
Works with both top navigation and sidebar navigation layouts - the plugin specifically targets the sub-navigation sidebar that appears on individual resource pages, not the main panel navigation.
Without Top Navigation (Sidebar Layout):

Requirements
- PHP 8.1+
- Laravel 10.0+
- Filament 3.0+ or 4.0+
Note: This plugin only affects sub-navigation sidebars (the secondary navigation within resource pages), not the main panel sidebar. It works regardless of whether you use top navigation or sidebar navigation for your main panel layout.
Installation
Install the package via composer:
composer require emuniq/filament-collapsible-subnav
That's it! The plugin will auto-register to all panels and work immediately with zero flash.
Optional: Theme Integration
For a slight performance boost, you can integrate the CSS into your Filament theme:
php artisan collapsible-subnav:install npm run build
This bundles the plugin CSS with your theme, reducing HTTP requests. Not required - the plugin works perfectly without this step.
Features
- ✅ Zero configuration - Auto-registers to all panels
- ✅ Collapsible sidebar toggle button
- ✅ Persistent state using cookies
- ✅ Server-side rendering support (no FOUC)
- ✅ Responsive design
- ✅ Smooth animations
- ✅ No theme, npm, or build step required
How It Works
The plugin automatically:
- Registers itself to all Filament panels on installation
- Injects CSS styles for the collapsible sidebar
- Adds a toggle button to sub-navigation sidebars only (not main panel navigation)
- Manages state persistence via cookies
- Applies server-side rendering for seamless loading
The plugin detects pages with sub-navigation and only applies to those specific sidebars, leaving your main panel navigation (top or sidebar) untouched.
Manual Registration (Optional)
If you prefer manual control, you can prevent auto-registration and register the plugin manually:
use Emuniq\FilamentCollapsibleSubnav\CollapsibleSubnavPlugin; public function panel(Panel $panel): Panel { return $panel // ... ->plugin(CollapsibleSubnavPlugin::make()); }
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 32
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-12-11
