PHPackages                             martin6363/filament-sidebar-resize - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Image &amp; Media](/categories/media)
4. /
5. martin6363/filament-sidebar-resize

ActiveLibrary[Image &amp; Media](/categories/media)

martin6363/filament-sidebar-resize
==================================

Drag-to-resize Filament v5 admin sidebar with localStorage persistence

v1.0.1(3w ago)4734MITPHP ^8.2|^8.3|^8.4

Since Jul 6Compare

[ Source](https://github.com/Martin6363/filament-sidebar-resize)[ Packagist](https://packagist.org/packages/martin6363/filament-sidebar-resize)[ Docs](https://github.com/martin6363/filament-sidebar-resize)[ RSS](/packages/martin6363-filament-sidebar-resize/feed)WikiDiscussions Synced 1w ago

READMEChangelog (1)Dependencies (4)Versions (3)Used By (0)

Filament Sidebar Resize
=======================

[](#filament-sidebar-resize)

Drag-to-resize sidebar for Filament v5 admin panels. Admin users can adjust the navigation sidebar width by dragging a handle on its edge. The chosen width is persisted in the browser via `localStorage` and restored on every visit and Livewire navigation.

No Vite, NPM, or Tailwind build step is required — the package injects a single Blade view with minimal inline CSS and vanilla JavaScript through Filament's render hook system.

---

Table of contents
-----------------

[](#table-of-contents)

1. [Features](#features)
2. [Requirements](#requirements)
3. [Installation](#installation)
4. [Configuration](#configuration)
5. [Panel registration](#panel-registration)
6. [Fluent API reference](#fluent-api-reference)
7. [Compatibility](#compatibility)
8. [How it works](#how-it-works)
9. [Publishing and customization](#publishing-and-customization)
10. [Troubleshooting](#troubleshooting)
11. [License](#license)

---

Features
--------

[](#features)

- **Drag-to-resize** — a visible grip handle on the sidebar edge lets users resize with the mouse (`col-resize` cursor).
- **Filament-native layout** — updates the `--sidebar-width` CSS variable and inline sidebar dimensions so `.fi-main` and the rest of the layout respond correctly.
- **localStorage persistence** — each Filament panel stores its own width key (`martin6363-sidebar-resize:{panelId}`).
- **Collapsible sidebar support** — works alongside `sidebarCollapsibleOnDesktop()`; inline width styles are cleared when the sidebar is collapsed and restored when expanded.
- **RTL-aware** — handle position and drag direction respect `dir="rtl"` layouts.
- **SPA-safe** — re-initializes cleanly on `livewire:navigated` without duplicate handles or event listeners.
- **Zero frontend build** — no asset compilation, no external JavaScript libraries.

---

Requirements
------------

[](#requirements)

- PHP `^8.2`, `^8.3`, or `^8.4`
- Laravel `^12`, or `^13`
- Filament `^5.0`

---

Installation
------------

[](#installation)

```
composer require martin6363/filament-sidebar-resize
```

The service provider is auto-discovered. Optionally publish the config file:

```
php artisan vendor:publish --tag=sidebar-resize-config
```

Register the plugin on your Filament panel (see [Panel registration](#panel-registration)).

---

Configuration
-------------

[](#configuration)

Published file: `config/sidebar-resize.php`

```
return [
    'min_width' => 200,
    'max_width' => 450,
];
```

KeyPurpose`min_width`Narrowest sidebar width in pixels when dragging. Default: `200`.`max_width`Widest sidebar width in pixels when dragging. Default: `450`.These defaults apply globally. Override per panel with the fluent `minWidth()` and `maxWidth()` methods on the plugin instance.

---

Panel registration
------------------

[](#panel-registration)

Add the plugin to your panel provider:

```
use Filament\Panel;
use Filament\PanelProvider;
use Martin6363\SidebarResize\SidebarResizePlugin;

class AdminPanelProvider extends PanelProvider
{
    public function panel(Panel $panel): Panel
    {
        return $panel
            ->id('admin')
            ->path('admin')
            ->plugins([
                SidebarResizePlugin::make(),
            ]);
    }
}
```

### With custom width limits

[](#with-custom-width-limits)

```
SidebarResizePlugin::make()
    ->minWidth(220)
    ->maxWidth(480),
```

### With a collapsible desktop sidebar

[](#with-a-collapsible-desktop-sidebar)

The plugin is designed to coexist with Filament's collapsible sidebar. No extra setup is required:

```
return $panel
    ->sidebarCollapsibleOnDesktop()
    ->plugins([
        SidebarResizePlugin::make(),
    ]);
```

When the sidebar is collapsed, resize styles are removed so Filament can render the narrow icon-only layout. When expanded again, the user's saved width is reapplied.

---

Fluent API reference
--------------------

[](#fluent-api-reference)

MethodDescription`SidebarResizePlugin::make()`Resolve the plugin singleton from the container.`minWidth(int $pixels)`Set the minimum draggable sidebar width. Overrides `config('sidebar-resize.min_width')`.`maxWidth(int $pixels)`Set the maximum draggable sidebar width. Overrides `config('sidebar-resize.max_width')`.---

Compatibility
-------------

[](#compatibility)

ScenarioBehaviorDesktop (`≥ 1024px`)Resize handle visible when the sidebar is open.Mobile (`< 1024px`)Handle hidden; Filament uses the overlay sidebar.`sidebarCollapsibleOnDesktop()`Resize applies only when expanded; collapse/expand works normally.`sidebarFullyCollapsibleOnDesktop()`Same inline-style clearing when the sidebar is closed.Top navigation layoutPlugin does not activate (`fi-body-has-top-navigation`).RTLDrag direction and handle edge use logical (`inline-end`) positioning.Livewire SPA (`wire:navigate`)Script re-inits on `livewire:navigated` with idempotent teardown.Multiple panelsEach panel gets a separate `localStorage` key based on `panel->getId()`.---

Publishing and customization
----------------------------

[](#publishing-and-customization)

TagContents`sidebar-resize-config``config/sidebar-resize.php````
php artisan vendor:publish --tag=sidebar-resize-config
```

Adjust `min_width` and `max_width` in the published config, or override limits per panel with `->minWidth()` and `->maxWidth()` on the plugin instance.

---

Troubleshooting
---------------

[](#troubleshooting)

**The resize handle does not appear**

- Confirm the plugin is registered in `->plugins([...])` on the active panel.
- The handle is desktop-only (`≥ 1024px` viewport width).
- The sidebar must be expanded (`fi-sidebar-open`). It is hidden when the sidebar is collapsed.
- Panels with top navigation (`->topNavigation()`) are intentionally excluded.

**Sidebar collapse stops working after installing the plugin**

- Update to the latest package version. Collapsible desktop sidebars require inline width styles to be cleared on collapse.
- Ensure you are not setting sidebar width elsewhere with inline styles or custom CSS that uses `!important`.

**Width resets after refresh**

- Check that `localStorage` is available and not blocked (private browsing restrictions, browser extensions).
- Each panel uses its own key: `martin6363-sidebar-resize:{panelId}`. Switching panels will load that panel's saved width.

**Width does not apply on first paint**

- The script runs at `BODY_END`. A brief flash of the default Filament width may occur before the saved width is applied. This is expected without a head-level blocking script.

**Drag feels laggy**

- Width updates during drag are already throttled through `requestAnimationFrame`. If custom CSS adds `transition` to the sidebar, the plugin disables transitions on the sidebar while dragging via `body.fi-sidebar-resizing`.

---

License
-------

[](#license)

The MIT License (MIT). Copyright (c) Martin.

###  Health Score

47

—

FairBetter than 93% of packages

Maintenance95

Actively maintained with recent releases

Popularity24

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~25 days

Total

2

Last Release

22d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/06a6e4a4e2e61ddef1bbfa6ee9b90c9bbf913fc9a15f532a4eb9bf8fa1147a19?d=identicon)[Martin6363](/maintainers/Martin6363)

---

Tags

pluginlaravelresizeadminfilamentsidebar

### Embed Badge

![Health badge](/badges/martin6363-filament-sidebar-resize/health.svg)

```
[![Health](https://phpackages.com/badges/martin6363-filament-sidebar-resize/health.svg)](https://phpackages.com/packages/martin6363-filament-sidebar-resize)
```

###  Alternatives

[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3915.5k](/packages/rawilk-profile-filament-plugin)[awcodes/filament-curator

A media picker plugin for FilamentPHP.

440384.7k28](/packages/awcodes-filament-curator)[stephenjude/filament-jetstream

A Laravel starter kit built with Filament inspired by Jetstream.

17861.9k3](/packages/stephenjude-filament-jetstream)[croustibat/filament-jobs-monitor

Background Jobs monitoring like Horizon for all drivers for FilamentPHP

278359.3k12](/packages/croustibat-filament-jobs-monitor)[finity-labs/fin-mail

A powerful email template manager and composer for Filament with dynamic token replacement, template versioning, and inline email sending.

316.8k2](/packages/finity-labs-fin-mail)[stephenjude/filament-debugger

About

104173.6k2](/packages/stephenjude-filament-debugger)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
