interactive
advanced
buttons
morphing
animations
loading
micro-interactions
Category · Interactive Difficulty Level · Advanced Published on · January 21, 2024

Morphing Button System

Advanced button system with liquid morphing animations, loading states, and success/error feedback. Features smooth transitions and micro-interactions.

#buttons #morphing #animations #loading #micro-interactions

Responsive Design

Yes

Dark Mode Support

No

lines

328

Browser Compatibility

No

Live Preview

Interact with the component without leaving the page.

350px

Overview

Advanced button system with liquid morphing animations, loading states, and success/error feedback. Features smooth transitions and micro-interactions.

How to use

  1. Copy the HTML markup into your page.
  2. Paste the CSS into your stylesheet and ensure the selectors match your markup.
  3. Paste the JavaScript and load it after the markup.
  4. 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>

              
38lines
1395characters
HTMLLanguage

Related Code Snippets

Explore template packs

Need larger building blocks? Browse responsive landing pages and component bundles.

Open HTML Template Library ->