Download the PHP package edulazaro/wiremodal without Composer
On this page you can find all versions of the php package edulazaro/wiremodal. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package wiremodal
wiremodal
Framework-agnostic modal/dialog system for Laravel, Livewire and Alpine. Pure CSS themes, custom-theme via CSS variables, drop-in API. Sibling of wiretoast.
10 themes · 11 sizes · 0 runtime deps · works with or without Livewire/Alpine.
Install
Add to your layout:
Or import into your Vite bundle (resources/css/app.css + resources/js/app.js):
Define a modal
Open / close
Livewire (PHP)
Under the hood these are macros that dispatch open-wiremodal / close-wiremodal browser events. If you prefer the raw form:
JavaScript (vanilla / Alpine)
Wiremodal.open() returns a Promise that resolves with the value passed to Wiremodal.close(name, result):
Custom events also work directly:
Legacy event names open-modal / close-modal are accepted too, useful when migrating from ad-hoc implementations.
From inside the markup
Any element with data-wm-dismiss inside a modal closes it (the built-in close X and overlay use this):
Receive the payload inside the modal
The payload passed to openModal() / Wiremodal.open() is delivered via a wiremodal:opened event on the modal element (and on window). Read it with Alpine:
Or plain JS:
Sizes
xs 20rem · sm 24rem · md 28rem · lg 32rem · xl 36rem · 2xl 42rem (default) · 3xl 48rem · 4xl 56rem · 5xl 64rem · 6xl 72rem · 7xl 80rem.
Persistent modals
persistent modals ignore overlay clicks and ESC. They only close via explicit data-wm-dismiss buttons or programmatic Wiremodal.close(). Useful for "must confirm" flows or wizards mid-step.
Block close on unsaved changes
The wiremodal:beforeclose event is cancelable. Call event.preventDefault() to keep the modal open.
The event detail includes reason: 'programmatic' | 'dismiss' | 'escape'.
Themes
Themes are applied via [data-wire-theme="..."] on any ancestor (commonly <html> or <body>). The same theme name applies across the whole wire* family.
| Theme | Vibe |
|---|---|
| default | Neutral light/dark, follows system |
soft |
Tinted background, no shadow, friendly |
glass |
Frosted backdrop blur |
gradient |
Vivid linear gradient panel, white text |
neon |
Dark panel, glowing accent border, mono font |
minimal |
No shadow, left accent stripe |
claude |
Warm minimal, Anthropic-inspired |
chatgpt |
Rounded, soft, large radius |
synthwave |
Retro 80s purple/magenta neon |
megaflow |
Flowbite-style: clean white card |
brutalist |
1px black border, hard offset shadow, hover lift |
Dark mode: set data-wire-theme-mode="dark" or add .dark class to ancestor.
Custom theme
Define your own by setting CSS variables on a scope:
For modal-specific overrides, use --wm-* variables (see wiremodal.css for the full list).
Anatomy
Lifecycle events (fire on both modal element and window):
| Event | Cancelable | detail |
|---|---|---|
wiremodal:beforeclose |
yes | { name, reason } |
wiremodal:opened |
no | { name, data } |
wiremodal:closed |
no | { name, result } |
License
MIT. Edu Lazaro.