1

I just created a fresh Laravel 12 project using the Livewire starter kit and added Flux UI.

Steps I followed:

laravel new my-app
# Selected starter kit:
> livewire

Then I followed the Flux UI documentation for the modal component: https://fluxui.dev/components/modal

Here’s the code I added:

<flux:modal.trigger name="edit-profile">
    <flux:button>Edit profile</flux:button>
</flux:modal.trigger>

<flux:modal name="edit-profile" class="md:w-96">
    ...
</flux:modal>

The modal opens correctly, and it closes if I click outside the modal, but the built-in close button (X) does nothing. I also checked the docs and tried re-generating assets with npm run dev, but the behavior is the same.

Am I missing a configuration step for Flux UI or Livewire?

Edit: Flux modal already has a built-in close button and logic for closing, so I’m not adding a custom one.

2
  • The close button needs the name attribute to know which modal to close. Try changing <flux:modal.close /> to <flux:modal.close name="edit-profile" /> Commented Aug 29 at 7:52
  • Flux modal component already comes with a built-in close button and closing logic. if I add a close button I will have two. Commented Aug 30 at 9:07

1 Answer 1

0

Run this command and your problem will be solved.

composer update livewire/livewire livewire/flux

Sign up to request clarification or add additional context in comments.

2 Comments

Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
Thanks, this fixed my issue must of been a flux v2.2.5 issue. Updated to v2.3.1 and its working now.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.