Skip to content

How to use <x-filament::modal> #3419

Answered by danharrin
bomshteyn asked this question in Help
Discussion options

You must be logged in to vote

For example, if you wanted a form modal:

<form wire:submit.prevent="livewireSubmitMethodHere">
    <x-filament::modal>
        <x-slot name="trigger">
            <button type="button" x-on:click="isOpen = true">Open</button>
        </x-slot>

        <x-slot name="header">
            Modal heading
        </x-slot>

        Form components here

        <x-slot name="actions">
            <button type="submit">
                 Submit form
            </button>
        </x-slot>
    </x-filament::modal>
</form>

But you can strip out the form stuff and use it for any use case

There are also browser events you can use to open and close the modal dynamically based on its ID. Check out mod…

Replies: 4 comments 5 replies

Comment options

You must be logged in to vote
5 replies
@bomshteyn
Comment options

@danharrin
Comment options

@bomshteyn
Comment options

@hazhayder
Comment options

@leandrocfe
Comment options

Answer selected by bomshteyn
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
7 participants