authentication
intermediate
login
form
authentication
animation
validation
Category · Authentication Difficulty Level · Intermediate Published on · August 22, 2025

Animated Login Form

Modern login form with smooth animations, validation, and social login options, perfect for user authentication.

#login #form #authentication #animation #validation

Responsive Design

Yes

Dark Mode Support

No

lines

629

Browser Compatibility

Chrome Β· Firefox Β· Safari Β· Edge

Live Preview

Interact with the component without leaving the page.

400px

Overview

Modern login form with smooth animations, validation, and social login options, perfect for user authentication.

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

66

lines

CSS

408

lines

JavaScript

155

lines


                <div class="login-form-container">
  <div class="login-form-demo">
    <div class="form-wrapper">
      <div class="form-header">
        <h2>Welcome Back</h2>
        <p>Sign in to your account</p>
      </div>
      
      <form class="login-form" id="loginForm">
        <div class="form-group">
          <label for="email">Email Address</label>
          <div class="input-wrapper">
            <input type="email" id="email" name="email" required placeholder="Enter your email">
            <div class="input-icon">βœ‰οΈ</div>
          </div>
        </div>
        
        <div class="form-group">
          <label for="password">Password</label>
          <div class="input-wrapper">
            <input type="password" id="password" name="password" required placeholder="Enter your password">
            <div class="input-icon">πŸ”’</div>
            <button type="button" class="toggle-password" id="togglePassword">πŸ‘οΈ</button>
          </div>
        </div>
        
        <div class="form-options">
          <label class="checkbox-label">
            <input type="checkbox" id="rememberMe" name="rememberMe">
            <span class="checkmark"></span>
            Remember me
          </label>
          <a href="#" class="forgot-password">Forgot password?</a>
        </div>
        
        <button type="submit" class="btn btn-primary" id="loginBtn">
          <span class="btn-text">Sign In</span>
          <span class="btn-spinner" id="loginSpinner"></span>
        </button>
        
        <div class="divider">
          <span>or continue with</span>
        </div>
        
        <div class="social-login">
          <button type="button" class="social-btn google">
            <span class="social-icon">G</span>
            <span class="social-text">Google</span>
          </button>
          <button type="button" class="social-btn facebook">
            <span class="social-icon">f</span>
            <span class="social-text">Facebook</span>
          </button>
          <button type="button" class="social-btn apple">
            <span class="social-icon">🍎</span>
            <span class="social-text">Apple</span>
          </button>
        </div>
        
        <div class="signup-link">
          Don't have an account? <a href="#">Sign up</a>
        </div>
      </form>
    </div>
  </div>
</div>

              
66lines
2344characters
HTMLLanguage

Browser Compatibility

Chrome

>= 50

Firefox

>= 45

Safari

>= 10

Edge

>= 15

Related Code Snippets

Explore template packs

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

Open HTML Template Library ->