Created
May 4, 2024 14:20
-
-
Save wjkoh/703a510d1568930d2cc328d4a55e7c97 to your computer and use it in GitHub Desktop.
Alpine.js + Pico CSS: Displaying a Loading Indicator on the HTML Form Submit Button
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div x-data="{ inProgress: false }"> | |
<form x-on:submit="inProgress = true" ...> | |
... | |
<button type="submit" x-bind:aria-busy="inProgress" x-text="inProgress ? 'Please wait...' : 'Generate'"></button> | |
</form> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment