Animated Loading Button
A modern button with smooth loading animation and state transitions, perfect for form submissions and async operations.
Responsive Design
Yes
Dark Mode Support
No
lines
123
Browser Compatibility
Chrome · Firefox · Safari · Edge
Live Preview
Interact with the component without leaving the page.
Overview
A modern button with smooth loading animation and state transitions, perfect for form submissions and async operations.
How to use
- Copy the HTML markup into your page.
- Paste the CSS into your stylesheet and ensure the selectors match your markup.
- Paste the JavaScript and load it after the markup.
- Adjust spacing, colors, and text to match your design system.
Customization tips
- Rename class names to avoid collisions with your existing CSS.
- Replace hard-coded colors with CSS variables for theming.
- Verify the layout at 320px, 768px, and 1024px widths.
HTML
9
lines
CSS
84
lines
JavaScript
30
lines
<div class="button-container">
<button class="loading-btn" id="loadingBtn" type="button" aria-live="polite" aria-busy="false" aria-disabled="false">
<span class="btn-text">Submit</span>
<span class="btn-loader">
<span class="spinner"></span>
</span>
</button>
<span class="sr-only" id="btnStatus" aria-live="polite"></span>
</div>
Browser Compatibility
Chrome
>= 50
Firefox
>= 45
Safari
>= 10
Edge
>= 15