Hiding a button after click
Livewire can handle loading states in the browser to provide responsive feedback
You can hide a button, and reveal alternate text or spinner when the button is clicked
When the button is pressed, the wire:loading.remove
will immediately hide the button until the request is complete. The target is itself. At the same time the span is revealed with the same wire:loading
and wire:target
directives. Once the request is complete, the two elements are swapped back.
Use this for long requests (such as sending an email) to prevent multiple requests from the user impatiently pressing the button.
Last updated