Requires:
Via Composer:
composer require linuxstreet/wire-content-modal
Modify your tailwind.config.js file, so it includes this package when building assets.
export default {
content: [
...
'./vendor/linuxstreet/wire-content-modal/resources/views/**/*.blade.php',
],
In web development, often we need to overlay a smaller window, or modal, on top of the main page to display additional information or allow user interaction. This modal can be populated with content from different sources, such as a Livewire component or a Blade view.
Place component on the web page
<livewire:content-modal/>
Modal is listening for 'modal-show' and 'modal-hide' browser events.
AlpineJS @click example:
<button x-data @click.throttle="$dispatch('modal-show', [=PARAMS])">Show</button>
Mandatory:
Optional:
Provide either 'component' or 'view' options like this:
{ component: 'livewire_component' }
or
{ view: 'blade_view' }
Examples with HTML button element using AlpineJS:
<button x-data @click.throttle="$dispatch('modal-show', [{ component: 'my-component' }] )">Show</button>
<button x-data @click.throttle="$dispatch('modal-show', [{ view: 'my-view' }] )">Show</button>
Please see the changelog for more information on what has changed recently.
This package uses TailwindCSS classes. If you want to customize the layout for different CSS framework use:
php artisan vendor:publish --provider="Linuxstreet\WireContentModal\WireContentModalServiceProvider"
./vendor/bin/pest
Please see contributing.md for details.
If you discover any security related issues, please email author email instead of using the issue tracker.
Please see the license file for more information.
How can I help you explore Laravel packages today?