Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Livewire Drag And Drop Laravel Package

artisanpack-ui/livewire-drag-and-drop

A Livewire drag-and-drop component from ArtisanPack UI for building sortable lists and moving items between lists without custom JavaScript. It handles reordering and drag events server-side through Livewire, making it easy to add interactive, sortable interfaces to Laravel apps.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Initial assessment for v2.1.0; no prior assessment exists.

Architecture fit: The package is a Laravel/Livewire-oriented drag-and-drop layer built on Alpine.js directives (x-drag-context / x-drag-item) with a rewritten Pointer Events engine. It fits Laravel applications that already use Livewire 3/4 and Alpine, especially admin panels, builders, kanban boards, sortable tables, and any UI needing accessible reordering. The 2.1 additions—connected containers, nested contexts, keyboard moves, lifecycle events, drop rules, optimistic moves with revert, translatable announcements, and styling state attributes—move it from a basic sortable helper toward a fuller interaction framework.

Integration feasibility: Feasible for Livewire/Alpine stacks. The package auto-registers on alpine:init and can also be installed explicitly via Alpine.plugin( LivewireDragAndDrop ). The 2.0 x-drag-context / x-drag-item directives and drag:end → orderedIds flow remain, so most existing markup should survive. The Livewire integration now uses the morphed hook, fixing a 2.0 defect where moved items stayed marked __livewire_ignore and stopped receiving server re-renders. That fix is important for production Livewire usage.

Technical risk: Moderate to high for existing 2.0 consumers because v2.1.0 is a minor release with breaking behavior changes:

  • Events no longer bubble. Listeners on ancestors, document, or Livewire #[On] handlers will silently stop receiving drag events. This is the highest-risk change and requires an audit of every event listener.
  • The UMD global window.LivewireDragAndDrop is now the plugin function, not a module namespace object. Script-tag consumers using the old shape will break.
  • Native HTML5 drag-and-drop is removed; items no longer receive draggable="true". CSS or JS depending on native DnD behavior will need adjustment.
  • aria-grabbed is no longer set. Accessibility tests or custom styling tied to that attribute may need updating.
  • New touch/pen behavior introduces press-and-hold semantics (touchDelay, default 200 ms), which can conflict with mobile scrolling expectations if not tuned.
  • Nested contexts and connected containers add substantial interaction complexity; event placement must be deliberate because events no longer cross context levels.

The real-browser keyboard and mouse tests reduce regression risk, but the notes do not claim touch/pen coverage in headless Chrome. Performance characteristics under large lists and deeply nested contexts are also unstated.

Key questions:

  • What Laravel, PHP, Livewire, Alpine, and browser versions are officially supported?
  • Is the package distributed through Composer, npm, or both, and what is the recommended Vite/asset-publishing path for Laravel apps?
  • What is the migration guidance for teams currently listening for drag events on ancestors or via Livewire #[On]?
  • Are the new drop-rule callbacks (accepts) purely client-side, and how should server-side authorization interact with them?
  • What is the expected persistence pattern for optimistic moves: drag:end/drag:drop plus a Livewire action, with revert(moveId) on failure?
  • What accessibility conformance target is supported (e.g. WCAG 2.2 AA), and has screen-reader testing been done beyond the announcement templates?
  • What are the performance limits for item count, container count, and nested context depth?
  • Does the package work with Livewire navigation/SPA transitions and repeated Alpine component initialization without duplicate listeners?
  • Is the minor-version breaking change intentional, or should consumers treat 2.1.0 as a major upgrade?

Integration Approach

Stack fit: Best fit is a Laravel application using Livewire 3 or 4 and Alpine.js for interactive UI. The package should be introduced at the Blade/Alpine layer, with Livewire components owning persistence and server validation. Teams not using Livewire can still use the Alpine plugin or UMD build, but they lose the built-in Livewire morph integration and must handle event wiring manually.

Migration path: Treat this as a controlled minor-version upgrade, not a drop-in patch. Sequence:

  1. Read docs/upgrading.md and inventory all existing drag listeners. Move any ancestor/document/#[On] listeners onto the x-drag-context element.
  2. Audit UMD consumers for the changed window.LivewireDragAndDrop shape.
  3. Remove reliance on native draggable="true" and aria-grabbed.
  4. Verify the Livewire morphed hook fix against existing components, especially lists that re-render after a drop.
  5. Re-test keyboard flows, because grouped contexts now use Left/Right to move between containers.
  6. Add data-drag-group only where cross-container movement is intended; leave ungrouped lists unchanged.

Compatibility: The notes explicitly cover Livewire 3 and 4, Alpine plugin registration, and preservation of the 2.0.1 named exports (registerDirectives, registerLivewireHooks). Pointer Events implies modern browser support; older browsers or embedded webviews need explicit validation. PHP/Laravel version constraints are not stated in the release notes and must be confirmed from composer.json.

Sequencing: Start with a development spike on one representative screen. Then migrate event listeners, wire server-side persistence and revert behavior, configure translations and keyboard bindings, and run a browser matrix covering mouse, touch, keyboard, and Livewire re-render scenarios. Roll out to internal users before production, with a feature flag or component-level opt-in if the app has many drag surfaces.

Operational Impact

Maintenance: The release workflow—tag-driven tests, npm publish with provenance, GitHub release from changelog, docs import—is a positive maintenance signal. The documentation set is expanding in the right areas. The main maintenance burden is the breaking change surface in a minor release: teams must track event-bubbling changes, UMD global changes, and native DnD removal. The package’s long-term health depends on keeping pace with Livewire and Alpine releases, especially Livewire 4.

Support: Internal support load will concentrate on event wiring and accessibility configuration. The translatable announcements and data-drag-label support are helpful, but product teams still own the actual copy and screen-reader validation. The revert APIs (revert(moveId), revertItem(itemId), $dragRevert) require backend error-handling patterns; without a documented server-side contract, teams may implement inconsistent optimistic UI behavior.

Scaling: Delegated document-level listeners and auto-scroll should be validated against large boards and long lists. Nested contexts are powerful but increase the chance of event leakage if listeners are placed incorrectly. The real-browser test suite is a good regression control, but it does not replace load/performance testing for high item counts. Bundle size and asset-loading strategy should be checked in the Laravel build pipeline.

Failure modes: The most likely production failures are silent: drag events stop firing because listeners remain on ancestors, UMD consumers break on the changed global, or server re-renders overwrite moved items due to improper Livewire integration. Touch drags may interfere with page scroll if touchDelay is too low. Drop-rule callbacks can throw and cancel drops unexpectedly. Revert flows can leave the UI inconsistent if server rejection handling is incomplete. Keyboard focus after Livewire morph is improved, but should still be tested.

Ramp-up: Medium. Teams already comfortable with Livewire and Alpine should adapt quickly; teams treating this as a generic sortable library will need training on lifecycle events, context grouping, drop rules, and optimistic revert. The new docs pages for connected containers, events, configuration, styling, and upgrading are the right onboarding material. A short internal enablement session plus one reference implementation should be sufficient before wider adoption.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
skyraptor/chatter
edlugz/sasapay
abbasudo/artisan-route
mirvan/ippanel
ignibyte/aic-framework
glavweb/data-schema-bundle
glavweb/datagrid-bundle
tacticmedia/scim-server
uni-method/frame
neika-ai/sdk
adachsoft/php-code-style
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
adachsoft/api-version-bundle
cgv/localized-resource