### Installation Source: https://context7.com/watheqalshowaiter/filament-sticky-table-header/llms.txt Instructions on how to install the Filament Sticky Table Header plugin using Composer and publish Filament assets. ```APIDOC ## Installation Install the package via Composer: ```bash composer require watheqalshowaiter/filament-sticky-table-header ``` After installation, publish the Filament assets: ```bash php artisan filament:assets ``` ``` -------------------------------- ### Configure Filament Panel with Sticky Table Header Plugin (PHP) Source: https://context7.com/watheqalshowaiter/filament-sticky-table-header/llms.txt This example demonstrates how to integrate the StickyTableHeaderPlugin into a Filament panel configuration. It shows the plugin being added to the middleware stack and configured with an option to enable smooth scrolling to the top when pages change. This setup is typical for a custom AdminPanelProvider. ```php default() ->id('admin') ->path('admin') ->login() ->colors([ 'primary' => Color::Amber, 'danger' => Color::Rose, 'success' => Color::Emerald, ]) ->discoverResources(in: app_path('Filament/Resources'), for: 'App\\Filament\\Resources') ->discoverPages(in: app_path('Filament/Pages'), for: 'App\\Filament\\Pages') ->discoverWidgets(in: app_path('Filament/Widgets'), for: 'App\\Filament\\Widgets') ->navigationGroups([ NavigationGroup::make()->label('Users'), NavigationGroup::make()->label('Settings'), ]) ->middleware([ EncryptCookies::class, AddQueuedCookiesToResponse::class, StartSession::class, AuthenticateSession::class, ShareErrorsFromSession::class, VerifyCsrfToken::class, SubstituteBindings::class, DisableBladeIconComponents::class, DispatchServingFilamentEvent::class, ]) ->authMiddleware([ Authenticate::class, ]) ->plugins([ // Add sticky table header with smooth scroll to top StickyTableHeaderPlugin::make() ->shouldScrollToTopOnPageChanged(enabled: true, behavior: 'smooth'), ]); } } ``` -------------------------------- ### Install and Configure Filament Sticky Table Header Source: https://context7.com/watheqalshowaiter/filament-sticky-table-header/llms.txt Commands to install the package via Composer and publish the necessary assets to your Laravel project. ```bash composer require watheqalshowaiter/filament-sticky-table-header php artisan filament:assets ``` -------------------------------- ### Install Filament Sticky Table Header via Composer Source: https://github.com/watheqalshowaiter/filament-sticky-table-header/blob/main/README.md Use this command to add the package to your Laravel project dependencies. ```bash composer require watheqalshowaiter/filament-sticky-table-header ``` -------------------------------- ### Override Sticky Header CSS Styles Source: https://context7.com/watheqalshowaiter/filament-sticky-table-header/llms.txt Custom CSS examples to override the default sticky header positioning, background colors, or container heights. ```css .fi-ta-table thead { position: sticky !important; top: 0; z-index: 9; } .fi-ta-content { max-height: calc(100vh - 15rem); } ``` -------------------------------- ### Get Plugin ID Source: https://context7.com/watheqalshowaiter/filament-sticky-table-header/llms.txt Retrieves the unique identifier string for the plugin. ```APIDOC ## getId() Returns the unique identifier string for the plugin, used internally by Filament for asset registration and plugin management. ### Request Example ```php getId(); ``` ``` -------------------------------- ### Publish Filament Assets Source: https://github.com/watheqalshowaiter/filament-sticky-table-header/blob/main/README.md Run this command to ensure all necessary assets for the plugin are published to your public directory. ```bash php artisan filament:assets ``` -------------------------------- ### Run Package Tests Source: https://github.com/watheqalshowaiter/filament-sticky-table-header/blob/main/README.md Execute the test suite to verify the package functionality within your environment. ```bash composer test ``` -------------------------------- ### Registering the Plugin Source: https://context7.com/watheqalshowaiter/filament-sticky-table-header/llms.txt Demonstrates how to register the StickyTableHeaderPlugin in your Filament panel provider. ```APIDOC ## StickyTableHeaderPlugin::make() Creates a new instance of the sticky table header plugin. This is the entry point for configuring and registering the plugin with your Filament panel. ### Request Example ```php default() ->id('admin') ->path('admin') ->login() ->colors([ 'primary' => '#F2911B', ]) ->discoverResources(in: app_path('Filament/Resources'), for: 'App\\Filament\\Resources') ->discoverPages(in: app_path('Filament/Pages'), for: 'App\\Filament\\Pages') ->plugins([ // Register the sticky table header plugin StickyTableHeaderPlugin::make(), ]); } } ``` ``` -------------------------------- ### Registering StickyTableHeaderPlugin Source: https://context7.com/watheqalshowaiter/filament-sticky-table-header/llms.txt How to integrate the StickyTableHeaderPlugin into your Filament PanelProvider configuration. ```APIDOC ## REGISTER StickyTableHeaderPlugin ### Description Registers the sticky table header functionality within a specific Filament panel. This enables the sticky header behavior and allows for optional configuration like automatic scroll-to-top on pagination. ### Method PHP Configuration ### Parameters #### Plugin Configuration - **shouldScrollToTopOnPageChanged** (boolean) - Optional - Whether to scroll to the top of the table when the user changes pagination pages. - **behavior** (string) - Optional - The scroll behavior, typically 'smooth' or 'auto'. ### Request Example ```php ->plugins([ StickyTableHeaderPlugin::make() ->shouldScrollToTopOnPageChanged(enabled: true, behavior: 'smooth'), ]) ``` ### Response - **Success** - The plugin is registered and will automatically apply sticky headers to all Filament tables within the panel. ``` -------------------------------- ### CSS Customization Source: https://context7.com/watheqalshowaiter/filament-sticky-table-header/llms.txt Information on how to customize the plugin's CSS for sticky headers and scrollable table containers. ```APIDOC ## CSS Customization The plugin injects CSS that makes table headers sticky and creates a scrollable container for the table content. You can override these styles in your own CSS if needed. ```css /* Default sticky header styles applied by the plugin */ .fi-ta-table thead { position: sticky !important; top: 0; z-index: 9; } /* Dark mode background for sticky header */ .dark .fi-ta-table thead { background-color: rgb(24, 24, 27); } /* Scrollable table container (supports both v3 and v4 class names) */ .fi-ta-content, .fi-ta-content-ctn { max-height: calc(100vh - 20rem); overflow-y: auto; position: relative; } /* Custom override example - adjust max height for shorter tables */ .fi-ta-content, .fi-ta-content-ctn { max-height: calc(100vh - 15rem); } ``` ``` -------------------------------- ### Configure Scroll to Top Behavior Source: https://github.com/watheqalshowaiter/filament-sticky-table-header/blob/main/README.md Enable and configure the automatic scroll-to-top behavior when table pages change, allowing for smooth or instant transitions. ```php ->plugins([ StickyTableHeaderPlugin::make() ->shouldScrollToTopOnPageChanged(enabled: true, behavior: "smooth") ]) ``` -------------------------------- ### Register StickyTableHeaderPlugin in Panel Provider Source: https://github.com/watheqalshowaiter/filament-sticky-table-header/blob/main/README.md Register the plugin within your Filament Panel provider to enable the sticky header functionality across your tables. ```php use WatheqAlshowaiter\FilamentStickyTableHeader\StickyTableHeaderPlugin; public function panel(Panel $panel): Panel { return $panel ->plugins([ StickyTableHeaderPlugin::make(), ]); } ``` -------------------------------- ### Scroll to Top Feature Source: https://context7.com/watheqalshowaiter/filament-sticky-table-header/llms.txt Configuration for the scroll-to-top behavior when changing pages, including options for animation. ```APIDOC ## shouldScrollToTopOnPageChanged() Enables automatic scroll-to-top behavior when users navigate between table pages (next, previous, or specific page numbers). This method accepts two parameters: `enabled` (boolean) to toggle the feature, and `behavior` (string) to control the scroll animation style. ### Request Example ```php default() ->id('admin') ->path('admin') ->plugins([ StickyTableHeaderPlugin::make() // Enable scroll to top with smooth animation ->shouldScrollToTopOnPageChanged(enabled: true, behavior: 'smooth'), ]); } } // Available behavior options: // 'smooth' - Animated smooth scrolling to the top // 'instant' - Immediate jump to the top without animation // 'auto' - Browser determines the scroll behavior (default) // Disable scroll to top feature StickyTableHeaderPlugin::make() ->shouldScrollToTopOnPageChanged(enabled: false); // Enable with instant scroll behavior StickyTableHeaderPlugin::make() ->shouldScrollToTopOnPageChanged(enabled: true, behavior: 'instant'); ``` ``` -------------------------------- ### Retrieve Plugin Identifier Source: https://context7.com/watheqalshowaiter/filament-sticky-table-header/llms.txt Access the unique internal ID of the plugin instance, useful for debugging or custom asset management. ```php $plugin = StickyTableHeaderPlugin::make(); $pluginId = $plugin->getId(); // Returns 'filament-sticky-table-header' ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.