🔐 Login & Signup Forms

Responsive forms with password toggle, real-time validation, and smooth tab switching.

Demo: any email + password (min 6 chars)
Demo validation: name (2+ chars), email, password (6+ chars), match
💻 Complete Code
<!-- HTML Structure -->
<div class="form-card">
  <div class="form-tabs">
    <button class="tab-btn active">Login</button>
    <button class="tab-btn">Sign Up</button>
  </div>
 
  <form id="loginForm">
    <input type="email" placeholder="Email">
    <input type="password" placeholder="Password">
    <button type="submit">Login</button>
  </form>
 
  <form id="signupForm">
    <input type="text" placeholder="Full Name">
    <input type="email" placeholder="Email">
    <input type="password" placeholder="Password">
    <input type="password" placeholder="Confirm Password">
    <button type="submit">Sign Up</button>
  </form>
</div>

<!-- CSS Highlights -->
.form-card { background: white; border-radius: 1.5rem; padding: 2rem; max-width: 450px; }
.input-wrapper input { width: 100%; padding: 0.75rem 1rem; border: 2px solid #e2e8f0; border-radius: 0.75rem; }
.input-wrapper input:focus { border-color: #3b82f6; }
.submit-btn { background: #3b82f6; color: white; padding: 0.75rem; border-radius: 0.75rem; }

<!-- JavaScript Features -->
// Tab switching
// Password toggle (show/hide)
// Form validation (email format, password length, match check)
// Error messages with inline display

🚀 Need More Form Components?

Get 5 premium form components in the Pro Pack: multi-step form, OTP input, floating labels, file upload with preview, password strength meter.

Get Pro Pack – $7 →

❤️ Found This Useful?

These free forms took time to build. A small coffee keeps them free.

☕ Buy Me a Coffee
← Back to all snippets