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
Inertia Modal

Inertia Modal Laravel Package

emargareten/inertia-modal

Inertia Modal lets Laravel and Inertia.js apps render pages as modals without extra routes or controllers, keeping server-side routing intact and navigation fast.

View on GitHub
Deep Wiki
Context7

Inertia Modal is a Laravel package that lets you implement backend-driven modal dialogs for Inertia apps.

Frequently asked questions about Inertia Modal
How do I install emargareten/inertia-modal in a Laravel app?
Install it with composer require emargareten/inertia-modal. Laravel package auto-discovery registers the service provider, so no manual provider entry is normally needed. You then render the package's host component in your persistent Inertia layout so it can read shared modal state and mount the correct modal component. Check the repository README for any config publishing or middleware registration specific to your version.
Does Inertia Modal work with Vue 3, React, and Svelte?
The package targets Laravel plus Inertia.js, but frontend adapter support varies and should be confirmed before committing. Verify in the README or source which adapters ship a host component and whether you import it from the package or publish it into your app. If your adapter is not covered, the host component is typically small enough to reimplement against the shared props the package exposes.
Do I need to add extra routes or controllers to open a modal?
No. Inertia Modal is designed around backend-driven modals, so modal identity and open state ride along with the normal Inertia response instead of requiring dedicated routes or controllers. Your existing controller returns a component and props as usual, and the host component in your layout decides which modal to mount. That keeps server-side routing intact and avoids duplicating endpoints for modal and full-page views.
How does modal state behave after a redirect or a validation error?
This depends on how the package transmits modal state: props persist across a refresh, while session flash disappears. The key scenario to test is a failed-validation back-redirect where a controller wants the modal to reopen with errors intact. Run a spike covering redirects, 303 responses, and validation-error redirects before relying on it for edit forms or wizard steps.
Does the browser back button close an open modal, and are modals deep-linkable?
Ideally an open modal is a real history entry, so Back closes it and the URL is shareable. Whether emargareten/inertia-modal does this depends on whether it pushes history state or relies purely on props and flash data. Test back and forward navigation explicitly, because failures here tend to surface as a steady trickle of UX inconsistency reports rather than a hard bug.
Is Inertia Modal compatible with Inertia v2 partial reloads, deferred props, and prefetching?
This is the highest-risk integration area. Inertia v2 changes how props arrive under only= partial reloads, deferred props, prefetching, and polling, so modal state delivered as a normal prop may behave differently than on a full visit. Spike partial reloads and prefetching first, and confirm whether modal-only data can be deferred so it is not fetched on every page load.
Does Inertia Modal handle accessibility, focus trapping, and the Escape key?
Accessibility is easy to get wrong and is not obviously in scope for a package this size. Validate focus trapping, aria-modal, Escape handling, and focus restoration against WCAG 2.2 dialog expectations. If the defaults fall short, wrapping the modal content in Headless UI, Radix, or Melt UI underneath is usually the pragmatic fix.
Can I use Inertia Modal with Inertia server-side rendering?
If you use Inertia SSR, confirm that the host component renders consistently on both server and client. Modal state that depends on browser-only APIs or client stores can produce hydration mismatches. Test an SSR build with a modal open and closed before shipping.
Is emargareten/inertia-modal production-ready and actively maintained?
It is a small, focused package with roughly 89 stars and a single maintainer, so treat it as a bet on one person's continued attention. Read the source and review the test suite for redirect chains, nested modals, and validation-error reopening, since those are the cases that break. Plan a fork or internal reimplementation as a realistic fallback, and compare against building the pattern yourself or using a client-side modal library if the package stalls.
Are nested or multi-step modals supported, and how do I test them?
Nested modals and modal-to-modal navigation are common requirements for wizard flows, but support should be verified rather than assumed. Check the source and test suite for how modal identity is stored when a second modal opens over the first. Write feature tests that open, nest, close, and re-open modals across redirects to catch state drift early.
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.
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console