Morphing Button System
Advanced button system with liquid morphing animations, loading states, and success/error feedback. Features smooth transitions and micro-interactions.
Responsive Design
Yes
Dark Mode Support
No
lines
328
Browser Compatibility
No
Live Preview
Interact with the component without leaving the page.
Overview
Advanced button system with liquid morphing animations, loading states, and success/error feedback. Features smooth transitions and micro-interactions.
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
38
lines
CSS
187
lines
JavaScript
103
lines
<div class="morphing-demo">
<div class="button-container">
<button class="morph-btn" data-state="idle">
<span class="btn-text">Click to Process</span>
<span class="btn-loader">
<svg class="circular" viewBox="25 25 50 50">
<circle class="path" cx="50" cy="50" r="20" fill="none" stroke-width="2"></circle>
</svg>
</span>
<span class="btn-success">β</span>
<span class="btn-error">β</span>
</button>
<div class="btn-examples">
<button class="morph-btn secondary" data-state="idle">
<span class="btn-text">Secondary Action</span>
<span class="btn-loader">
<svg class="circular" viewBox="25 25 50 50">
<circle class="path" cx="50" cy="50" r="20" fill="none" stroke-width="2"></circle>
</svg>
</span>
<span class="btn-success">β</span>
<span class="btn-error">β</span>
</button>
<button class="morph-btn outline" data-state="idle">
<span class="btn-text">Outline Style</span>
<span class="btn-loader">
<svg class="circular" viewBox="25 25 50 50">
<circle class="path" cx="50" cy="50" r="20" fill="none" stroke-width="2"></circle>
</svg>
</span>
<span class="btn-success">β</span>
<span class="btn-error">β</span>
</button>
</div>
</div>
</div>