承接 anish/resizable-modal 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

anish/resizable-modal

Composer 安装命令:

composer require anish/resizable-modal

包简介

Filament v4/v5 plugin for resizable action modals using native Width breakpoints

README 文档

README

Filament v4/v5 plugin that adds drag-to-resize handles on action modals. Width snaps through Filament's native Width breakpoints (fi-width-* classes), so resized modals behave the same as ->modalWidth(Width::*).

Inspired by asmit/resized-column resized-column.

Resizable Modal cover

Requirements

  • PHP 8.2+
  • Filament v4 (Livewire v3) or Filament v5 (Livewire v4)
  • Laravel 10+ with Filament v4, or Laravel 11+ with Filament v5

Features

  • Corner resize handles on all four modal corners
  • Snaps to Filament Width enum breakpoints (3xs through screen-2xl)
  • Persists per-action width in localStorage (optional)
  • Works on table, header, bulk, and view actions with forms
  • Global registration or per-action opt-in
  • Panel plugin or standalone configuration

Works with

  • Record actions (row actions)
  • Bulk actions
  • Header actions (list & view pages)
  • CreateAction
  • EditAction (with ->modal())
  • Custom Action::make() with schema

Skipped when

  • Confirmation-only (no form)
  • Slide-over modals
  • Width::Screen
  • Plugin disabled

Compatibility

Filament Livewire Laravel Status
v4.x v3 10+ Supported
v5.x v4 11+ Supported

The same APIs are used on both versions: Action::configureUsing(), extraModalWindowAttributes(), hasFormWrapper(), Filament\Support\Enums\Width, and PanelsRenderHook::SCRIPTS_AFTER. No version-specific configuration is required.

Installation

composer require anish/resizable-modal

Register the plugin in your panel provider:

use Anish\ResizableModal\ResizableModalPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        ->plugins([
            ResizableModalPlugin::make(),
        ]);
}

Publish config (optional):

php artisan vendor:publish --tag=resizable-modal-config

Configuration

// config/resizable-modal.php
return [
    'enabled' => true,
    'register_on_actions' => true,
    'persist_in_local_storage' => true,
    'local_storage_prefix' => 'filament.resizable-modal',
];

Plugin methods

ResizableModalPlugin::make()
    ->enabled(fn (): bool => true)
    ->registerOnActions(true)
    ->persistInLocalStorage(true)
    ->localStoragePrefix('my-app.resizable-modal')
    ->resizableWidths(['sm', 'md', 'lg', 'xl', '2xl', '3xl', '4xl', '5xl', '6xl', '7xl']);

Standalone (without panel plugin)

// app/Providers/AppServiceProvider.php
use Anish\ResizableModal\ResizableModalPlugin;

public function boot(): void
{
    ResizableModalPlugin::standalone()
        ->persistInLocalStorage(true);
}

Per-action opt-in

Disable global registration and attach manually:

// config/resizable-modal.php
'register_on_actions' => false,

// On a specific action:
use Anish\ResizableModal\Support\ResizableModal;

Action::make('edit')
    ->extraModalWindowAttributes(ResizableModal::extraAttributes(), merge: true);

Eligible modals

Resize is applied when all of the following are true:

  • Action has a form wrapper (schema)
  • Not a confirmation-only modal
  • Not a slide-over
  • Modal width is not Width::Screen

Usage

  1. Open any eligible action modal.
  2. Drag any corner handle diagonally to change width.
  3. Double-click a corner handle to reset to the action's default width.

Troubleshooting

If handles appear but resize does nothing:

  1. Hard refresh the browser (Ctrl+Shift+R).
  2. Clear stale localStorage keys from older versions:
Object.keys(localStorage)
  .filter((key) => key.includes("resizable-modal"))
  .forEach((key) => localStorage.removeItem(key));

License

MIT. See LICENSE.txt.

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: Blade

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-06-24

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固