gboquizosanchez/filament-scroll-to-top
A lightweight Filament plugin that adds a smooth scroll-to-top button to your admin panels, letting users jump back to the top of long pages with one click. Easy to install via Composer and simple to configure to match your panel's design.
This is a small, single-purpose Filament plugin that injects a floating "scroll to top" control into a panel's rendered output. Version 1.0.2 is a patch on the 1.0.x line; the changelog entry links a compare diff with no described breaking changes, so treat it as a drop-in upgrade from 1.0.1.
Minimal setup:
composer require gboquizosanchez/filament-scroll-to-top — confirm the resolved version with composer show gboquizosanchez/filament-scroll-to-top before assuming the 1.0.2 behaviour, since the release notes are empty.app/Providers/Filament/*PanelProvider.php:public function panel(Panel $panel): Panel
{
return $panel
// ...
->plugins([
\Gboquizosanchez\FilamentScrollToTop\ScrollToTopPlugin::make(),
]);
}
php artisan filament:optimize-clear or php artisan optimize:clear) and hard-refresh — Filament caches panel configuration aggressively.php artisan vendor:publish --provider="Gboquizosanchez\FilamentScrollToTop\FilamentScrollToTopServiceProvider" (check vendor/gboquizosanchez/filament-scroll-to-top/README.md for the exact tags exposed in this version; the tag set is the one thing most likely to have shifted between patches).Where to look first:
README.md in the package root — the authoritative source for the plugin class name, config keys, and publish tags for this specific tag.src/ScrollToTopPlugin.php — the fluent API surface. Anything you can configure is a public method here; read it rather than guessing option names.resources/views/ — the Blade partial that renders the button. This is your override target.composer.json — the illuminate/support and filament/filament constraints tell you whether this patch is safe on your Filament major.First use case: enable it on a panel with long resource tables and forms (a users index with 50+ rows, or a settings page with many sections), scroll down, confirm the button appears, and confirm clicking it returns you to the top without a full page reload.
Per-panel scoping. Register the plugin only on the panels with long pages. Public-facing or auth panels rarely need it, and every panel you add it to is another place the fixed-position button can collide with other UI:
->plugins([
ScrollToTopPlugin::make(),
])
->discoverResources(in: app_path('Filament/Admin/Resources'), for: 'App\\Filament\\Admin\\Resources')
Fluent configuration over view overrides. Prefer whatever ScrollToTopPlugin exposes (threshold, colour, icon, position) over publishing and editing the Blade view. The view is the package's internal implementation detail; a patch release like 1.0.2 can restyle or restructure it and your copy will silently go stale.
Theme integration. Point the button at your panel's primary colour so it doesn't look bolted on. If the plugin accepts a colour, pass it from ->colors([...]) using the same value. If it doesn't, this is the one legitimate case for a CSS override in your panel's custom theme:
.fi-scroll-to-top {
background-color: rgb(var(--primary-500));
}
Conditional rendering via render hooks. For page-level control (e.g. show it on list pages but not on a full-screen dashboard), disable the plugin's own render and mount it yourself with a PanelsRenderHook scoped by page class. This is more code but keeps the decision next to the page instead of buried in panel config.
Multi-panel and multi-tenant. Register the same plugin instance shape across panels rather than sharing one configured instance object — Filament panel configs are built per-panel and reusing a mutated plugin instance across panels can leak configuration between them.
Testing. There is very little to unit-test here, but if you assert on panel HTML in feature tests, remember the button markup is now part of every panel page. Snapshot-style assertions that compare whole <body> output will break on this upgrade; scope assertions to the elements you actually care about.
Upgrade workflow. Because 1.0.2 ships no prose changelog, review the diff before bumping in a shared codebase:
composer update gboquizosanchez/filament-scroll-to-top --with-dependencies
git diff 1.0.1 1.0.2 -- vendor/gboquizosanchez/filament-scroll-to-top # or compare on GitHub
Pin with "gboquizosanchez/filament-scroll-to-top": "1.0.*" so patches land but minors don't surprise you.
filament/filament. If you're on Filament v4 or a pre-release, verify compatibility explicitly rather than assuming 1.0.x implies broad support.wire:navigate / SPA mode. Filament navigates client-side. A button implemented with plain JS listeners attached on DOMContentLoaded will stop working after the first Livewire navigation. If the button goes dead after clicking a nav link, that's the cause — the fix belongs in the package (a livewire:navigated listener), so check the diff for it before writing your own patch.z-index can float over an open modal — check that the package hides it when a modal is open, and if not, hide it yourself on modal-open events.--primary-*, --gray-*) so the button inherits both themes.php artisan optimize:clear is mandatory — stale bootstrap/cache/config.php is the single most common "the plugin isn't doing anything" cause.FilamentAsset, remember those are served from public/ and need php artisan filament:assets (or an filament:upgrade) after a version bump in production deploys.How can I help you explore Laravel packages today?