the14thsky / filament-sidebar-coscroll
Makes the Filament panel sidebar scroll together with the page
Package info
github.com/the14thsky/filament-sidebar-coscroll
pkg:composer/the14thsky/filament-sidebar-coscroll
Fund package maintenance!
Requires
- php: ^8.2
- filament/filament: ^4.0|^5.0
- spatie/laravel-package-tools: ^1.15.0
Requires (Dev)
- larastan/larastan: ^3.0
- laravel/pint: ^1.0
- nunomaduro/collision: ^8.0
- orchestra/testbench: ^9.0|^10.0|^11.0
- pestphp/pest: ^3.7|^4.0
- pestphp/pest-plugin-arch: ^3.0|^4.0
- pestphp/pest-plugin-laravel: ^3.0|^4.0
- rector/rector: ^2.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-10-10 09:59:41 UTC
README
Filament Sidebar Co-scroll
Filament gives a long sidebar its own scroll box. Sidebar Co-scroll makes it move with the page instead: scroll down and it follows until its last item reaches the bottom of the window; scroll up and it comes straight back, stopping under the topbar. A menu that fits stays put.
It works with every sidebar layout (collapsible, fully collapsible and top navigation) and with the mobile drawer. There's no theme to rebuild or config to publish, and it only loads on the panels you register it on.
Requires Filament 4 or 5.
Installation
composer require the14thsky/filament-sidebar-coscroll
The plugin ships a small compiled stylesheet and script, so no theme or Tailwind changes are needed. Filament publishes them when Composer runs php artisan filament:upgrade. Otherwise, run:
php artisan filament:assets
Usage
Register the plugin on each panel that should co-scroll:
use The14thsky\SidebarCoscroll\SidebarCoscrollPlugin; public function panel(Panel $panel): Panel { return $panel // ... ->plugin(SidebarCoscrollPlugin::make()); }
Panels without the plugin keep Filament's own sidebar scrolling.
Options
| Method | Default | Description |
|---|---|---|
topbarOffset(?string $offset) |
4rem |
Height of everything above the sidebar, such as the topbar and any banner. The sidebar's minimum height is the window height minus this. |
mobileDrawer(bool $condition = true) |
true |
Whether the open mobile drawer co-scrolls with the page. |
SidebarCoscrollPlugin::make() ->topbarOffset('6.25rem') ->mobileDrawer(false)
Known limitations
In SPA mode, Filament normally keeps the sidebar's scroll position when you move between pages. With co-scroll the sidebar scrolls with the page instead, and each SPA navigation starts the new page at the top, so the sidebar starts from the top too. After clicking an item far down a long menu, you'll need to scroll back down to see it.
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.
