mrshanebarron/modal
A Laravel package for creating modal dialogs in your applications. Render configurable, reusable modals from Blade views with a simple API for opening, closing, and passing data—keeping markup and behavior organized without extra JavaScript wiring.
Feature delivery — which UI patterns to build now. Modal dialogs are the substrate for a large share of small, high-value features: destructive-action confirmations ("Delete workspace?"), quick-create and quick-edit forms, record preview/detail drawers, onboarding announcements, and multi-step wizards via stacked modals. A PM routinely trades "a sprint of front-end work" against "ship the feature this cycle," and this package collapses that trade — it is the difference between a confirmation dialog being a task in the backlog versus a two-hour integration.
Build vs buy for UI infrastructure. The realistic alternative is not a competing Composer package; it's an engineer hand-rolling a modal system (focus trap, ESC handling, ARIA attributes, backdrop, body scroll lock, stacked-layer z-index management). That is commonly 3–5 engineering days plus a permanent accessibility bug surface. Framing the decision as "buy a week of front-end capacity for a dependency" is the correct framing, and it is the strongest argument for adoption.
Whether to fund a design system. Adoption defers the "do we need a real component library?" conversation. If the product only needs dialogs, sheets, and forms in a server-rendered admin surface, this plus Blade covers it. That is a meaningful roadmap de-risking decision: you avoid a large platform investment to unblock a mid-size feature set.
The server-driven modal pattern specifically. The differentiated capability here is opening a modal from PHP — controllers, Livewire components, redirects, and validation-error flows — rather than from client-side state. Many product requirements are naturally "the server decides a dialog must appear" (post-redirect confirmation, "your session expired," "you have 3 unread conflicts"). Deciding to standardize on that pattern is a product/UX decision as much as a technical one, and this package makes it cheap.
Accessibility and compliance posture. Accessible markup and focus trapping are increasingly table stakes against internal a11y audits and procurement questionnaires. Choosing a package that ships this by default is a decision to stop accumulating a11y debt per dialog, and it is worth stating explicitly to whoever owns compliance.
Standardization vs. per-team autonomy. The real decision is "one modal implementation across the app" or "each team does what it wants." Standardizing has a UX-consistency and a11y upside; the strategic choice is adopt one implementation, and this package is a candidate for that slot — not a foregone conclusion.
Risk acceptance. Zero stars, a single maintainer, and a v1.0.1 release (with a config-namespace rename already shipped as a patch) mean this is a risk-acceptance call, not purely a technical one. A PM should consciously decide the blast radius they're willing to accept and whether the team is prepared to fork if the maintainer disappears.
Consider adopting when:
Look elsewhere when:
<dialog> element plus a small amount of JS is cheaper than owning a dependency.Gates to insist on before commitment: confirmed license, an explicit Laravel/PHP version support matrix, presence of tests or CI, evidence of issue-tracker responsiveness, and a named internal owner accountable for upgrades and for watching advisories.
To executives — the opportunity and the honest risk. This is a small, cheap dependency that lets us ship a whole class of common UI patterns — confirmation dialogs, quick-edit forms, multi-step flows — without spending a sprint building modal infrastructure ourselves and without prematurely funding a design system. Integration cost is a few hours; runtime cost is effectively zero. The risk is not technical depth, it is vendor concentration: one maintainer, zero community traction, and a young v1.0.1 release that has already shipped a config-namespace change as a patch. So the recommendation is deliberately scoped rather than enthusiastic: pilot it on internal and admin surfaces first, keep it out of customer-critical revenue paths until it has proven itself, and keep the exit cheap by confining all usage behind our own thin wrapper component — so replacing it later is a one-file change, not a codebase-wide refactor. The downside case is "we lose a day ripping it out," not "we're locked in."
To engineering — the ask and the contract. The value proposition is the server-driven modal pattern: open modals fluently from controllers, Livewire components, redirects, and validation-error flows without hand-writing JavaScript per dialog. Out of the box it brings accessible markup and focus trapping, stacked modals with backdrop and scroll-lock handling, and publishable config and views for customization. Integration is the standard Composer plus service-provider plus publish path, so there is no new runtime, no infrastructure change, and no ops surface. What we need from you before we commit: confirm that Blade/Livewire is our target UI surface, verify the package's supported Laravel and PHP versions against ours, confirm the license, and give us a read on sustainability. Then we pin it at ^1.0.1 — never * — wrap it in our own component, and assign a named owner for upgrades. If any of those checks fail, our fallback ceiling on the buy decision is roughly a one-week internal build against the native <dialog> element. Making that fallback explicit is what turns this from a leap of faith into a reversible bet.
How can I help you explore Laravel packages today?