Skip to content

Instantly share code, notes, and snippets.

@wjkoh
Created May 4, 2024 14:20
Show Gist options
  • Save wjkoh/703a510d1568930d2cc328d4a55e7c97 to your computer and use it in GitHub Desktop.
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
<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